Skip to content

Commit

Permalink
[Backport 9_1_X] fix(android): native modules should use min sdk for …
Browse files Browse the repository at this point in the history
…dependency (#11953)

* fix(android): modules should not depend on internal modules

* fix(android): pom should use manifest minsdk

Co-authored-by: Gary Mathews <contact@garymathews.com>
  • Loading branch information
build and garymathews authored Aug 25, 2020
1 parent f807178 commit 46acb4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ AndroidModuleBuilder.prototype.generateModuleProject = async function generateMo
moduleMavenArtifactId: mavenArtifactId,
moduleName: this.manifest.name,
moduleVersion: this.manifest.version,
moduleMinSdkVersion: this.manifest.minsdk,
moduleArchitectures: this.manifest.architectures.split(' '),
tiBindingsJsonPath: path.join(this.platformPath, 'titanium.bindings.json'),
tiMavenUrl: encodeURI('file://' + path.join(this.platformPath, 'm2repository').replace(/\\/g, '/')),
Expand Down
8 changes: 7 additions & 1 deletion android/templates/module/generated/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,13 @@ publishing {
def childNode = dependenciesNode.appendNode('dependency')
childNode.appendNode('groupId', it.group)
childNode.appendNode('artifactId', it.name)
childNode.appendNode('version', it.version)

// Use minimum SDK specified by module manifest.
if ((it.group == 'org.appcelerator') && (it.name == 'titanium')) {
childNode.appendNode('version', '<%- moduleMinSdkVersion %>')
} else {
childNode.appendNode('version', it.version)
}
}
}
}
Expand Down

0 comments on commit 46acb4c

Please sign in to comment.