Skip to content

Commit

Permalink
fix: use react-native.config.js for linking the library
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jun 21, 2022
1 parent 31cf29f commit 1000cd7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,6 @@ dependencies {
} else {
implementation jscFlavor
}

<% if (project.native) { -%>
implementation project(':<%- project.package %>')
<% } -%>
}

if (isNewArchitectureEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
import com.example.<%- project.package %>.newarchitecture.MainApplicationReactNativeHost;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
<% if (project.native) { -%>
import com.<%- project.package %>.<%- project.name %>Package;
<% } -%>

public class MainApplication extends Application implements ReactApplication {

Expand All @@ -31,7 +28,6 @@ protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
<% if (project.native) { -%>packages.add(new <%- project.name %>Package());<% } -%>
return packages;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,3 @@ if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true")
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
}

<% if (project.native) { -%>
include ':<%- project.package %>'
project(':<%- project.package %>').projectDir = new File(rootProject.projectDir, '../../android')
<% } -%>
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ target '<%- project.name %>Example' do
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
<% if (project.native) { -%>
pod '<%- project.identifier %>', :path => '../..'
<% } -%>

# Enables Flipper.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const path = require('path');

module.exports = {
<% if (project.native) { -%>
dependencies: {
'<%- project.package %>': {
root: path.join(__dirname, '..'),
},
},
<% } -%>
};

0 comments on commit 1000cd7

Please sign in to comment.