File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,14 +52,16 @@ export class BuildPluginCommand implements ICommand {
5252 const tempAndroidProject = await this . $tempService . mkdirSync (
5353 "android-project"
5454 ) ;
55- const gradleArgs = ( this . $projectData . nsConfig . android . gradleArgs || [ ] . concat ( this . $options . gradleArgs || [ ] ) ) ;
55+ const gradleArgs = ( this . $projectData . nsConfig . android . gradleArgs || [ ] ) . concat ( this . $options . gradleArgs || [ ] ) ;
56+ const pluginOptions = ( this . $projectData . nsConfig . android . plugins || { } ) [ pluginName ] || { } ;
5657 const options : IPluginBuildOptions = {
5758 gradlePath : this . $options . gradlePath ,
5859 gradleArgs,
5960 aarOutputDir : platformsAndroidPath ,
6061 platformsAndroidDirPath : platformsAndroidPath ,
6162 pluginName : pluginName ,
6263 tempPluginDirPath : tempAndroidProject ,
64+ ...pluginOptions
6365 } ;
6466
6567 const androidPluginBuildResult = await this . $androidPluginBuildService . buildAar (
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ interface IAndroidBuildOptions {
1212 tempPluginDirPath : string ;
1313 gradleArgs ?: string [ ] ;
1414 gradlePath ?: string ;
15+ aarSuffix ?: string ;
1516}
1617
1718interface IAndroidPluginBuildService {
Original file line number Diff line number Diff line change @@ -147,6 +147,8 @@ interface INsConfigAndroid extends INsConfigPlaform {
147147
148148 gradleArgs ?: string [ ] ;
149149
150+ plugins ?:{ [ k :string ] : { aarSuffix ?: string } }
151+
150152 runtimePackageName ?: string
151153}
152154
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
193193 const androidSourceDirectories = this . getAndroidSourceDirectories (
194194 options . platformsAndroidDirPath
195195 ) ;
196- const shortPluginName = getShortPluginName ( options . pluginName ) ;
196+ const shortPluginName = getShortPluginName ( options . pluginName + ( options . aarSuffix || '' ) ) ;
197197 const pluginTempDir = path . join ( options . tempPluginDirPath , shortPluginName ) ;
198198 const pluginSourceFileHashesInfo = await this . getSourceFilesHashes (
199199 options . platformsAndroidDirPath ,
@@ -228,7 +228,7 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
228228 options . projectDir ,
229229 options . pluginName
230230 ) ;
231- const gradleArgs = ( this . $projectData . nsConfig . android . gradleArgs || [ ] . concat ( options . gradleArgs || [ ] ) ) ;
231+ const gradleArgs = ( this . $projectData . nsConfig . android . gradleArgs || [ ] ) . concat ( options . gradleArgs || [ ] ) ;
232232 await this . buildPlugin ( {
233233 gradlePath : options . gradlePath ,
234234 gradleArgs,
Original file line number Diff line number Diff line change @@ -758,7 +758,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
758758 AndroidProjectService . ANDROID_PLATFORM_NAME
759759 ) ;
760760 if ( this . $fs . exists ( pluginPlatformsFolderPath ) ) {
761- const gradleArgs = ( projectData . nsConfig . android . gradleArgs || [ ] . concat ( this . $options . gradleArgs || [ ] ) ) ;
761+ const gradleArgs = ( projectData . nsConfig . android . gradleArgs || [ ] ) . concat ( this . $options . gradleArgs || [ ] ) ;
762+ const pluginOptions = ( projectData . nsConfig . android . plugins || { } ) [ pluginData . name ] || { } ;
762763 const options : IPluginBuildOptions = {
763764 gradlePath : this . $options . gradlePath ,
764765 gradleArgs,
@@ -767,6 +768,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
767768 platformsAndroidDirPath : pluginPlatformsFolderPath ,
768769 aarOutputDir : pluginPlatformsFolderPath ,
769770 tempPluginDirPath : path . join ( projectData . platformsDir , "tempPlugin" ) ,
771+ ...pluginOptions
770772 } ;
771773
772774 if ( await this . $androidPluginBuildService . buildAar ( options ) ) {
Original file line number Diff line number Diff line change @@ -69,9 +69,10 @@ export class GradleBuildArgsService implements IGradleBuildArgsService {
6969 `-PappPath=${ this . $projectData . getAppDirectoryPath ( ) } ` ,
7070 `-PappResourcesPath=${ this . $projectData . getAppResourcesDirectoryPath ( ) } `
7171 ) ;
72- if ( buildData . gradleArgs ) {
72+ const gradleArgs = ( this . $projectData . nsConfig . android . gradleArgs || [ ] ) . concat ( buildData . gradleArgs || [ ] ) ;
73+ if ( gradleArgs ) {
7374 const additionalArgs : string [ ] = [ ] ;
74- buildData . gradleArgs . forEach ( ( arg ) => {
75+ gradleArgs . forEach ( ( arg ) => {
7576 additionalArgs . push ( ...arg . split ( " " ) . map ( ( a ) => a . trim ( ) ) ) ;
7677 } ) ;
7778 args . push ( ...additionalArgs ) ;
Original file line number Diff line number Diff line change @@ -255,7 +255,6 @@ export class PluginsService implements IPluginsService {
255255 const currentPluginNativeHashes = await this . getPluginNativeHashes (
256256 pluginPlatformsFolderPath
257257 ) ;
258-
259258 if (
260259 ! oldPluginNativeHashes ||
261260 this . $filesHashService . hasChangesInShasums (
Original file line number Diff line number Diff line change @@ -401,15 +401,23 @@ dependencies {
401401
402402task addDependenciesFromNativeScriptPlugins {
403403 nativescriptDependencies. each { dep ->
404- def aarFiles = fileTree(dir : file(" $rootDir /${ dep.directory} /$PLATFORMS_ANDROID " ), include : [" **/*.aar" ])
404+ def aarFiles = fileTree(dir : file(" $rootDir /${ dep.directory} /$PLATFORMS_ANDROID " )). matching {
405+ include " **/*.aar"
406+ exclude " cpp/**"
407+ exclude project. hasProperty(" aarIgnoreFilter" ) ? project. findProperty(' aarIgnoreFilter' ). split(' ,' ). collect{it as String } : []
408+ }
405409 aarFiles. each { aarFile ->
406410 def length = aarFile. name. length() - 4
407411 def fileName = aarFile. name[0 .. < length]
408412 outLogger. withStyle(Style.SuccessHeader ). println " \t + adding aar plugin dependency: " + aarFile. getAbsolutePath()
409413 project. dependencies. add(" implementation" , [name : fileName, ext : " aar" ])
410414 }
411415
412- def jarFiles = fileTree(dir : file(" $rootDir /${ dep.directory} /$PLATFORMS_ANDROID " ), include : [" **/*.jar" ])
416+ def jarFiles = fileTree(dir : file(" $rootDir /${ dep.directory} /$PLATFORMS_ANDROID " )). matching {
417+ include " **/*.jar"
418+ exclude " cpp/**"
419+ exclude project. hasProperty(" jarIgnoreFilter" ) ? project. findProperty(' jarIgnoreFilter' ). split(' ,' ). collect{it as String } : []
420+ }
413421 jarFiles. each { jarFile ->
414422 def jarFileAbsolutePath = jarFile. getAbsolutePath()
415423 outLogger. withStyle(Style.SuccessHeader ). println " \t + adding jar plugin dependency: $jarFileAbsolutePath "
Original file line number Diff line number Diff line change @@ -317,7 +317,11 @@ android {
317317
318318task addDependenciesFromNativeScriptPlugins {
319319 nativescriptDependencies. each { dep ->
320- def aarFiles = fileTree(dir : getDepPlatformDir(dep), include : [" **/*.aar" ])
320+ def aarFiles = fileTree(dir : getDepPlatformDir(dep)). matching {
321+ include " **/*.aar"
322+ exclude " cpp/**"
323+ exclude project. hasProperty(" aarIgnoreFilter" ) ? project. findProperty(' aarIgnoreFilter' ). split(' ,' ). collect{it as String } : []
324+ }
321325 def currentDirname = file(project. buildscript. sourceFile). getParentFile(). getName()
322326 aarFiles. each { aarFile ->
323327 def length = aarFile. name. length() - 4
@@ -329,7 +333,11 @@ task addDependenciesFromNativeScriptPlugins {
329333 project. dependencies. add(" implementation" , [name : fileName, ext : " aar" ])
330334 }
331335
332- def jarFiles = fileTree(dir : getDepPlatformDir(dep), include : [" *.jar" ])
336+ def jarFiles = fileTree(dir : getDepPlatformDir(dep)). matching {
337+ include " **/*.jar"
338+ exclude " cpp/**"
339+ exclude project. hasProperty(" jarIgnoreFilter" ) ? project. findProperty(' jarIgnoreFilter' ). split(' ,' ). collect{it as String } : []
340+ }
333341 jarFiles. each { jarFile ->
334342 def jarFileAbsolutePath = jarFile. getAbsolutePath()
335343 outLogger. withStyle(Style.SuccessHeader ). println " \t + adding jar plugin dependency: $jarFileAbsolutePath "
You can’t perform that action at this time.
0 commit comments