Skip to content

Commit 7dc0af2

Browse files
committed
refactor: drop code for old react native versions
we don't need them for new architecture since new architecture is not supported in those versions.
1 parent bc1b53e commit 7dc0af2

File tree

4 files changed

+4
-31
lines changed

4 files changed

+4
-31
lines changed

packages/create-react-native-library/templates/native-common/android/build.gradle

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,13 @@ def getExtOrIntegerDefault(name) {
3434
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["<%- project.name -%>_" + name]).toInteger()
3535
}
3636

37-
def supportsNamespace() {
38-
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
39-
def major = parsed[0].toInteger()
40-
def minor = parsed[1].toInteger()
41-
42-
// Namespace support was added in 7.3.0
43-
return (major == 7 && minor >= 3) || major >= 8
44-
}
45-
4637
android {
47-
if (supportsNamespace()) {
4838
<% if (project.moduleConfig === 'nitro-modules') { -%>
49-
namespace "com.margelo.nitro.<%- project.package -%>"
39+
namespace "com.margelo.nitro.<%- project.package -%>"
5040
<% } else { -%>
51-
namespace "com.<%- project.package -%>"
41+
namespace "com.<%- project.package -%>"
5242
<% } -%>
5343

54-
sourceSets {
55-
main {
56-
manifest.srcFile "src/main/AndroidManifestNew.xml"
57-
}
58-
}
59-
}
60-
6144
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
6245

6346
defaultConfig {
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.<%- project.package -%>">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
</manifest>

packages/create-react-native-library/templates/native-common/android/src/main/AndroidManifestNew.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/create-react-native-library/templates/native-common/{%- project.name %}.podspec

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,4 @@ Pod::Spec.new do |s|
2525
add_nitrogen_files(s)
2626
<% } -%>
2727
28-
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
29-
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
30-
if respond_to?(:install_modules_dependencies, true)
31-
install_modules_dependencies(s)
32-
else
33-
s.dependency "React-Core"
34-
end
35-
end
28+
install_modules_dependencies(s)

0 commit comments

Comments
 (0)