Skip to content

Commit ca8fe19

Browse files
committed
share buildscript block between gradle scripts
We will need these as variables so they can be shared with future changes we are going to make to maven-push.gradle. "apply from:" doesn't have an option to share the classpath.
1 parent 7e163e8 commit ca8fe19

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

OneSignalSDK/build.gradle

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,29 @@ buildscript {
1919
ktlintVersion = '1.0.1'
2020
// DO NOT upgrade for tests, using an old version so it matches AOSP
2121
tdunningJsonForTest = '1.0'
22-
}
2322

24-
repositories {
25-
google()
26-
mavenCentral()
27-
gradlePluginPortal()
28-
// Huawei maven
29-
maven { url 'https://developer.huawei.com/repo/' }
23+
sharedRepos = {
24+
google()
25+
mavenCentral()
26+
gradlePluginPortal()
27+
// Huawei maven
28+
maven { url 'https://developer.huawei.com/repo/' }
29+
}
30+
sharedDeps = [
31+
"com.android.tools.build:gradle:$androidGradlePluginVersion",
32+
"com.google.gms:google-services:$googleServicesGradlePluginVersion",
33+
"com.huawei.agconnect:agcp:$huaweiAgconnectVersion",
34+
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion",
35+
"org.jlleitschuh.gradle:ktlint-gradle:$ktlintPluginVersion",
36+
"com.vanniktech.maven.publish:com.vanniktech.maven.publish.gradle.plugin:0.32.0"
37+
]
3038
}
31-
dependencies {
32-
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
33-
classpath "com.google.gms:google-services:$googleServicesGradlePluginVersion"
34-
classpath "com.huawei.agconnect:agcp:$huaweiAgconnectVersion"
35-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
36-
classpath "org.jlleitschuh.gradle:ktlint-gradle:$ktlintPluginVersion"
39+
40+
buildscript {
41+
repositories sharedRepos
42+
dependencies {
43+
classpath sharedDeps
44+
}
3745
}
3846
}
3947

0 commit comments

Comments
 (0)