Skip to content

Commit 0591a53

Browse files
committed
refactor: rename common properties
1 parent dd6cbb3 commit 0591a53

File tree

9 files changed

+78
-77
lines changed

9 files changed

+78
-77
lines changed

test-app/app/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ def METADATA_OUT_PATH = "$projectDir/src/main/assets/metadata"
8282
def pluginsJarLibraries = new LinkedList<String>()
8383
def allJarLibraries = new LinkedList<String>()
8484

85-
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "${kotlin_version}" }
86-
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : COMPILE_SDK_VERSION as int }
87-
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : COMPILE_SDK_VERSION as int }
85+
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "${ns_default_kotlin_version}" }
86+
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : NS_DEFAULT_COMPILE_SDK_VERSION as int }
87+
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : NS_DEFAULT_COMPILE_SDK_VERSION as int }
8888
def computeBuildToolsVersion = { ->
89-
project.hasProperty("buildToolsVersion") ? buildToolsVersion : BUILD_TOOLS_VERSION as String
89+
project.hasProperty("buildToolsVersion") ? buildToolsVersion : NS_DEFAULT_BUILD_TOOLS_VERSION as String
9090
}
9191

9292
def enableAnalytics = (project.hasProperty("gatherAnalyticsData") && project.gatherAnalyticsData == "true")
@@ -198,7 +198,7 @@ android {
198198

199199
defaultConfig {
200200
def manifest = new XmlSlurper().parse(file(android.sourceSets.main.manifest.srcFile))
201-
def minSdkVer = manifest."uses-sdk"."@android:minSdkVersion".text() ?: MIN_SDK_VERSION
201+
def minSdkVer = manifest."uses-sdk"."@android:minSdkVersion".text() ?: NS_DEFAULT_MIN_SDK_VERSION
202202
minSdkVersion minSdkVer
203203
targetSdkVersion computeTargetSdkVersion()
204204
ndk {
@@ -303,45 +303,45 @@ repositories {
303303
}
304304

305305
dependencies {
306-
// println "\t ~ [DEBUG][app] build.gradle - android_x_app_compat_version = ${android_x_app_compat_version}..."
306+
// println "\t ~ [DEBUG][app] build.gradle - ns_default_androidx_appcompat_version = ${ns_default_androidx_appcompat_version}..."
307307

308-
def androidXAppCompatVersion = "${android_x_app_compat_version}"
308+
def androidXAppCompatVersion = "${ns_default_androidx_appcompat_version}"
309309
if (project.hasProperty("androidXAppCompat")) {
310310
androidXAppCompatVersion = androidXAppCompat
311311
outLogger.withStyle(Style.SuccessHeader).println "\t + using android X library androidx.appcompat:appcompat:$androidXAppCompatVersion"
312312
}
313313

314-
def androidXMaterialVersion = "${android_x_material_version}"
314+
def androidXMaterialVersion = "${ns_default_androidx_material_version}"
315315
if (project.hasProperty("androidXMaterial")) {
316316
androidXMaterialVersion = androidXMaterial
317317
outLogger.withStyle(Style.SuccessHeader).println "\t + using android X library com.google.android.material:material:$androidXMaterialVersion"
318318
}
319319

320-
def androidXExifInterfaceVersion = "${android_x_exif_interface_version}"
320+
def androidXExifInterfaceVersion = "${ns_default_androidx_exifinterface_version}"
321321
if (project.hasProperty("androidXExifInterface")) {
322322
androidXExifInterfaceVersion = androidXExifInterface
323323
outLogger.withStyle(Style.SuccessHeader).println "\t + using android X library androidx.exifinterface:exifinterface:$androidXExifInterfaceVersion"
324324
}
325325

326-
def androidXViewPagerVersion = "${android_x_view_pager_version}"
326+
def androidXViewPagerVersion = "${ns_default_androidx_viewpager_version}"
327327
if (project.hasProperty("androidXViewPager")) {
328328
androidXViewPagerVersion = androidXViewPager
329329
outLogger.withStyle(Style.SuccessHeader).println "\t + using android X library androidx.viewpager2:viewpager2:$androidXViewPagerVersion"
330330
}
331331

332-
def androidXFragmentVersion = "${android_x_fragment_version}"
332+
def androidXFragmentVersion = "${ns_default_androidx_fragment_version}"
333333
if (project.hasProperty("androidXFragment")) {
334334
androidXFragmentVersion = androidXFragment
335335
outLogger.withStyle(Style.SuccessHeader).println "\t + using android X library androidx.fragment:fragment:$androidXFragmentVersion"
336336
}
337337

338-
def androidXTransitionVersion = "${android_x_transition_version}"
338+
def androidXTransitionVersion = "${ns_default_androidx_transition_version}"
339339
if (project.hasProperty("androidXTransition")) {
340340
androidXTransitionVersion = androidXTransition
341341
outLogger.withStyle(Style.SuccessHeader).println "\t + using android X library androidx.transition:transition:$androidXTransitionVersion"
342342
}
343343

344-
def androidXMultidexVersion = "${android_x_multidex_version}"
344+
def androidXMultidexVersion = "${ns_default_androidx_multidex_version}"
345345
if (project.hasProperty("androidXMultidex")) {
346346
androidXMultidexVersion = androidXMultidex
347347
outLogger.withStyle(Style.SuccessHeader).println "\t + using android X library androidx.multidex:multidex:$androidXMultidexVersion"

test-app/build-tools/android-metadata-generator/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
}
2222

2323
dependencies {
24-
classpath "com.android.tools.build:gradle:$ANDRIOD_BUILD_TOOLS_VERSION"
24+
classpath "com.android.tools.build:gradle:$NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION"
2525
}
2626
}
2727

@@ -53,15 +53,15 @@ repositories {
5353
}
5454

5555
dependencies {
56-
// println "\t ~ [DEBUG][android-metadata-generator] build.gradle - bcel_version = ${bcel_version}..."
56+
// println "\t ~ [DEBUG][android-metadata-generator] build.gradle - ns_default_bcel_version = ${ns_default_bcel_version}..."
5757

58-
api "org.apache.bcel:bcel:${bcel_version}"
59-
api "com.google.code.gson:gson:${gson_version}"
60-
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-metadata-jvm', version: "${kotlinx_metadata_jvm_version}"
58+
api "org.apache.bcel:bcel:${ns_default_bcel_version}"
59+
api "com.google.code.gson:gson:${ns_default_gson_version}"
60+
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-metadata-jvm', version: "${ns_default_kotlinx_metadata_jvm_version}"
6161
implementation files("./src/libs/dx.jar")
6262

63-
testImplementation "junit:junit:${junit_version}"
64-
testImplementation "org.mockito:mockito-core:${mockito_core_version}"
63+
testImplementation "junit:junit:${ns_default_junit_version}"
64+
testImplementation "org.mockito:mockito-core:${ns_default_mockito_core_version}"
6565
}
6666

6767
task copyNecessaryFiles {

test-app/build-tools/static-binding-generator/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ repositories {
1919
}
2020

2121
dependencies {
22-
api "org.ow2.asm:asm:${asm_version}"
23-
api "org.ow2.asm:asm-util:${asm_util_version}"
24-
api "org.apache.bcel:bcel:${bcel_version}"
25-
api group: 'org.json', name: 'json', version: "${json_version}"
26-
api "commons-io:commons-io:${commons_io_version}"
27-
api "com.google.code.gson:gson:${gson_version}"
28-
api "com.google.googlejavaformat:google-java-format:${google_java_format_version}"
22+
api "org.ow2.asm:asm:${ns_default_asm_version}"
23+
api "org.ow2.asm:asm-util:${ns_default_asm_util_version}"
24+
api "org.apache.bcel:bcel:${ns_default_bcel_version}"
25+
api group: 'org.json', name: 'json', version: "${ns_default_json_version}"
26+
api "commons-io:commons-io:${ns_default_commons_io_version}"
27+
api "com.google.code.gson:gson:${ns_default_gson_version}"
28+
api "com.google.googlejavaformat:google-java-format:${ns_default_google_java_format_version}"
2929

30-
testImplementation "com.google.code.gson:gson:${gson_version}"
31-
testImplementation "junit:junit:${junit_version}"
32-
testImplementation "org.mockito:mockito-core:${mockito_core_version}"
30+
testImplementation "com.google.code.gson:gson:${ns_default_gson_version}"
31+
testImplementation "junit:junit:${ns_default_junit_version}"
32+
testImplementation "org.mockito:mockito-core:${ns_default_mockito_core_version}"
3333
}
3434

3535
compileJava {

test-app/build-tools/static-binding-generator/runtests.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ repositories {
2222
}
2323

2424
dependencies {
25-
// println "\t ~ [DEBUG][static-binding-generator] runtests.gradle - asm_version = ${asm_version}..."
25+
// println "\t ~ [DEBUG][static-binding-generator] runtests.gradle - ns_default_asm_version = ${ns_default_asm_version}..."
2626

27-
api "org.ow2.asm:asm:${asm_version}"
28-
api "org.ow2.asm:asm-util:${asm_util_version}"
29-
api "org.apache.bcel:bcel:${bcel_version}"
30-
api group: 'org.json', name: 'json', version: "${json_version}"
31-
api "commons-io:commons-io:${commons_io_version}"
32-
api "com.google.code.gson:gson:${gson_version}"
33-
api "com.google.googlejavaformat:google-java-format:${google_java_format_version}"
27+
api "org.ow2.asm:asm:${ns_default_asm_version}"
28+
api "org.ow2.asm:asm-util:${ns_default_asm_util_version}"
29+
api "org.apache.bcel:bcel:${ns_default_bcel_version}"
30+
api group: 'org.json', name: 'json', version: "${ns_default_json_version}"
31+
api "commons-io:commons-io:${ns_default_commons_io_version}"
32+
api "com.google.code.gson:gson:${ns_default_gson_version}"
33+
api "com.google.googlejavaformat:google-java-format:${ns_default_google_java_format_version}"
3434

35-
testImplementation "com.google.code.gson:gson:${gson_version}"
36-
testImplementation "junit:junit:${junit_version}"
37-
testImplementation "org.mockito:mockito-core:${mockito_core_version}"
35+
testImplementation "com.google.code.gson:gson:${ns_default_gson_version}"
36+
testImplementation "junit:junit:${ns_default_junit_version}"
37+
testImplementation "org.mockito:mockito-core:${ns_default_mockito_core_version}"
3838
}
3939

4040
def appRoot = file(project.appRoot).getAbsolutePath()

test-app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ version of the {N} CLI install a previous version of the runtime package - 'tns
132132
applyBuildScriptConfigurations()
133133
applyBeforePluginGradleConfiguration()
134134

135-
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "${kotlin_version}" }
136-
def computeBuildToolsVersion = { -> project.hasProperty("androidBuildToolsVersion") ? androidBuildToolsVersion : "${ANDRIOD_BUILD_TOOLS_VERSION}" }
135+
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "${ns_default_kotlin_version}" }
136+
def computeBuildToolsVersion = { -> project.hasProperty("androidBuildToolsVersion") ? androidBuildToolsVersion : "${NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION}" }
137137
def kotlinVersion = computeKotlinVersion()
138138
def androidBuildToolsVersion = computeBuildToolsVersion()
139139

test-app/gradle.properties

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,28 @@ org.gradle.jvmargs=-Xmx16384M
1919
android.enableJetifier=true
2020
android.useAndroidX=true
2121

22-
BUILD_TOOLS_VERSION=31.0.0
23-
COMPILE_SDK_VERSION=31
24-
MIN_SDK_VERSION=17
25-
ANDRIOD_BUILD_TOOLS_VERSION=7.1.2
22+
# Default versions used throughout the gradle configurations
23+
NS_DEFAULT_BUILD_TOOLS_VERSION=31.0.0
24+
NS_DEFAULT_COMPILE_SDK_VERSION=31
25+
NS_DEFAULT_MIN_SDK_VERSION=17
26+
NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION=7.1.2
2627

27-
gson_version = 2.9.0
28-
bcel_version = 6.5.0
29-
junit_version = 4.13.2
30-
mockito_core_version = 3.0.0
31-
kotlinx_metadata_jvm_version = 0.4.2
32-
kotlin_version = 1.6.0
33-
android_x_app_compat_version = 1.4.1
34-
android_x_material_version = 1.5.0
35-
android_x_exif_interface_version = 1.3.3
36-
android_x_view_pager_version = 1.0.0
37-
android_x_fragment_version = 1.4.1
38-
android_x_transition_version = 1.4.1
39-
android_x_multidex_version = 2.0.1
40-
commons_io_version = 2.6
41-
spotbugs_version = 3.1.12
42-
google_java_format_version = 1.6
43-
json_version = 20180813
44-
asm_util_version = 7.0
45-
asm_version = 7.0
28+
ns_default_androidx_appcompat_version = 1.4.1
29+
ns_default_androidx_exifinterface_version = 1.3.3
30+
ns_default_androidx_fragment_version = 1.4.1
31+
ns_default_androidx_material_version = 1.5.0
32+
ns_default_androidx_multidex_version = 2.0.1
33+
ns_default_androidx_transition_version = 1.4.1
34+
ns_default_androidx_viewpager_version = 1.0.0
35+
ns_default_asm_util_version = 7.0
36+
ns_default_asm_version = 7.0
37+
ns_default_bcel_version = 6.5.0
38+
ns_default_commons_io_version = 2.6
39+
ns_default_google_java_format_version = 1.6
40+
ns_default_gson_version = 2.9.0
41+
ns_default_json_version = 20180813
42+
ns_default_junit_version = 4.13.2
43+
ns_default_kotlin_version = 1.6.0
44+
ns_default_kotlinx_metadata_jvm_version = 0.4.2
45+
ns_default_mockito_core_version = 3.0.0
46+
ns_default_spotbugs_version = 3.1.12

test-app/runtime-binding-generator/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apply plugin: 'java-library'
22

33
dependencies {
4-
// println "\t ~ [DEBUG][runtime-binding-generator] build.gradle - junit_version = ${junit_version}..."
4+
// println "\t ~ [DEBUG][runtime-binding-generator] build.gradle - ns_default_junit_version = ${ns_default_junit_version}..."
55

6-
testImplementation "junit:junit:${junit_version}"
6+
testImplementation "junit:junit:${ns_default_junit_version}"
77
}
88

99
sourceCompatibility = JavaVersion.VERSION_1_7

test-app/runtime/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ println "Runtime using NDK_PATH: " + NDK_PATH
5050

5151
android {
5252

53-
compileSdkVersion COMPILE_SDK_VERSION as int
54-
buildToolsVersion BUILD_TOOLS_VERSION as String
53+
compileSdkVersion NS_DEFAULT_COMPILE_SDK_VERSION as int
54+
buildToolsVersion NS_DEFAULT_BUILD_TOOLS_VERSION as String
5555

5656
sourceSets {
5757
main {
@@ -71,8 +71,8 @@ android {
7171
}
7272

7373
defaultConfig {
74-
minSdkVersion MIN_SDK_VERSION as int
75-
targetSdkVersion COMPILE_SDK_VERSION as int
74+
minSdkVersion NS_DEFAULT_MIN_SDK_VERSION as int
75+
targetSdkVersion NS_DEFAULT_COMPILE_SDK_VERSION as int
7676

7777
if (!optimized && !optimizedWithInspector) {
7878
project.archivesBaseName = "${archivesBaseName}-regular"
@@ -104,7 +104,7 @@ android {
104104
}
105105

106106
ndk {
107-
minSdkVersion MIN_SDK_VERSION as int
107+
minSdkVersion NS_DEFAULT_MIN_SDK_VERSION as int
108108
if (onlyX86) {
109109
abiFilters 'x86'
110110
} else {
@@ -137,11 +137,11 @@ allprojects {
137137
}
138138

139139
dependencies {
140-
// println "\t ~ [DEBUG][runtime] build.gradle - junit_version = ${junit_version}..."
140+
// println "\t ~ [DEBUG][runtime] build.gradle - ns_default_junit_version = ${ns_default_junit_version}..."
141141

142142
implementation fileTree(include: ['*.jar'], dir: 'libs')
143-
testImplementation "junit:junit:${junit_version}"
144-
testImplementation "org.mockito:mockito-core:${mockito_core_version}"
143+
testImplementation "junit:junit:${ns_default_junit_version}"
144+
testImplementation "org.mockito:mockito-core:${ns_default_mockito_core_version}"
145145
}
146146

147147
tasks.whenTaskAdded { task ->

0 commit comments

Comments
 (0)