Skip to content

Commit 29ab9d1

Browse files
Kureev Alexeygrabbou
authored andcommitted
Fix native modules linking in 0.29.1
Summary: Attempt to fix #8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes #8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
1 parent 70fe990 commit 29ab9d1

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = function makeImportPatch(packageImportPath) {
22
return {
3-
pattern: 'import com.facebook.react.ReactActivity;',
3+
pattern: 'import com.facebook.react.ReactApplication;',
44
patch: '\n' + packageImportPath,
55
};
66
};

local-cli/rnpm/link/src/android/registerNativeModule.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ module.exports = function registerNativeAndroidModule(
2727
applyPatch(projectConfig.stringsPath, makeStringsPatch(params, name));
2828

2929
applyPatch(
30-
projectConfig.mainActivityPath,
30+
projectConfig.mainFilePath,
3131
makePackagePatch(androidConfig.packageInstance, params, name)
3232
);
3333

3434
applyPatch(
35-
projectConfig.mainActivityPath,
35+
projectConfig.mainFilePath,
3636
makeImportPatch(androidConfig.packageImportPath)
3737
);
3838
};

local-cli/rnpm/link/src/android/unregisterNativeModule.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ module.exports = function unregisterNativeAndroidModule(
3636
revokePatch(projectConfig.stringsPath, makeStringsPatch(params, name));
3737

3838
revokePatch(
39-
projectConfig.mainActivityPath,
39+
projectConfig.mainFilePath,
4040
makePackagePatch(androidConfig.packageInstance, params, name)
4141
);
4242

4343
revokePatch(
44-
projectConfig.mainActivityPath,
44+
projectConfig.mainFilePath,
4545
makeImportPatch(androidConfig.packageImportPath)
4646
);
4747
};

local-cli/rnpm/link/test/android/patches/0.17/makeImportPatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const makeImportPatch = require('../../../../src/android/patches/0.17/makeImport
77
const applyPatch = require('../../../../src/android/patches/applyPatch');
88

99
const projectConfig = {
10-
mainActivityPath: 'MainActivity.java',
10+
mainFilePath: 'MainActivity.java',
1111
};
1212

1313
const packageImportPath = 'import some.example.project';

local-cli/rnpm/link/test/android/patches/0.17/makePackagePatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const makePackagePatch = require('../../../../src/android/patches/0.17/makePacka
77
const applyPatch = require('../../../../src/android/patches/applyPatch');
88

99
const projectConfig = {
10-
mainActivityPath: 'MainActivity.java',
10+
mainFilePath: 'MainActivity.java',
1111
};
1212

1313
const packageInstance = 'new SomeLibrary(${foo}, ${bar}, \'something\')';

local-cli/rnpm/link/test/android/patches/0.18/makeImportPatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const makeImportPatch = require('../../../../src/android/patches/0.18/makeImport
77
const applyPatch = require('../../../../src/android/patches/applyPatch');
88

99
const projectConfig = {
10-
mainActivityPath: 'MainActivity.java',
10+
mainFilePath: 'MainActivity.java',
1111
};
1212

1313
const packageImportPath = 'import some.example.project';

local-cli/rnpm/link/test/android/patches/0.18/makePackagePatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const makePackagePatch = require('../../../../src/android/patches/0.18/makePacka
77
const applyPatch = require('../../../../src/android/patches/applyPatch');
88

99
const projectConfig = {
10-
mainActivityPath: 'MainActivity.java',
10+
mainFilePath: 'MainActivity.java',
1111
};
1212

1313
const packageInstance = 'new SomeLibrary(${foo}, ${bar}, \'something\')';

local-cli/rnpm/link/test/android/patches/0.20/makeImportPatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const makeImportPatch = require('../../../../src/android/patches/0.20/makeImport
77
const applyPatch = require('../../../../src/android/patches/applyPatch');
88

99
const projectConfig = {
10-
mainActivityPath: 'MainActivity.java',
10+
mainFilePath: 'MainActivity.java',
1111
};
1212

1313
const packageImportPath = 'import some.example.project';

local-cli/rnpm/link/test/android/patches/0.20/makePackagePatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const makePackagePatch = require('../../../../src/android/patches/0.20/makePacka
77
const applyPatch = require('../../../../src/android/patches/applyPatch');
88

99
const projectConfig = {
10-
mainActivityPath: 'MainActivity.java',
10+
mainFilePath: 'MainActivity.java',
1111
};
1212

1313
const packageInstance = 'new SomeLibrary(${foo}, ${bar}, \'something\')';

0 commit comments

Comments
 (0)