Skip to content

Commit 29cce12

Browse files
committed
adapt project template to copy optimized runtime aar by default
1 parent c52c6f2 commit 29cce12

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

build-artifacts/project-template-gradle/build.gradle

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,22 @@ dependencies {
205205
// compile files("$rootDir/libs/aar") {
206206
// builtBy 'copyAarDependencies'
207207
// }
208-
208+
copyNativeScriptAar()
209+
209210
compile project(':runtime')
210211
}
211212

212213

214+
def copyNativeScriptAar() {
215+
def runtimeAarType = project.hasProperty("nooptimize") ? "regular" : "optimized";
216+
217+
copy {
218+
from "$projectDir/libs/runtime-libs/nativescript-${runtimeAarType}.aar"
219+
into "$projectDir/libs/runtime-libs/"
220+
rename "nativescript-${runtimeAarType}.aar", "nativescript.aar"
221+
}
222+
}
223+
213224
////////////////////////////////////////////////////////////////////////////////////
214225
///////////////////////////// CONFIGURATION PHASE //////////////////////////////////
215226
////////////////////////////////////////////////////////////////////////////////////

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ task generateRuntimeAar(type: Exec) {
141141

142142
task copyGeneratedRuntime << {
143143
copy {
144-
from "$rootDir/runtime/build/outputs/aar/runtime-release.aar"
144+
from "$rootDir/runtime/build/outputs/aar/runtime-regular-release.aar"
145145
into "$rootDir/dist/framework/libs/runtime-libs/"
146-
rename "runtime-release.aar", "nativescript.aar"
146+
rename "runtime-regular-release.aar", "nativescript-regular.aar"
147147
}
148148

149149
copy {

runtime/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ model {
202202
defaultConfig.with {
203203
if(optimized) {
204204
project.archivesBaseName = "${archivesBaseName}-optimized"
205+
} else {
206+
project.archivesBaseName = "${archivesBaseName}-regular"
205207
}
206208

207209
minSdkVersion.apiLevel = 17
@@ -265,10 +267,6 @@ model {
265267
minifyEnabled = false
266268
proguardFiles.add(file('proguard-rules.txt'))
267269

268-
if(optimized) {
269-
versionNameSuffix '-optimized'
270-
}
271-
272270
ndk {
273271
debuggable = ndkDebuggable
274272

0 commit comments

Comments
 (0)