Skip to content

Commit d4d5384

Browse files
authored
Merge pull request #147 from MovingBlocks/prepare-kotlin
Prepare kotlin, version catalog
2 parents f59546d + 865de79 commit d4d5384

File tree

13 files changed

+183
-164
lines changed

13 files changed

+183
-164
lines changed

build.gradle

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,6 @@ plugins {
1818
id 'idea'
1919
}
2020

21-
ext {
22-
// Android version support
23-
android_annotation_version = "28.0.0"
24-
25-
// Standard Utility
26-
guava_version = "27.0.1-android"
27-
slf4j_version = "1.7.25"
28-
gson_version = "2.8.5"
29-
jcip_annotation_version = "1.0"
30-
31-
// Testing
32-
junit_version = "4.12"
33-
logback_version = "1.2.3"
34-
mockito_version = "1.10.19"
35-
}
36-
3721
allprojects {
3822
repositories {
3923
google()

gestalt-android-testbed/build.gradle

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Copyright 2021 The Terasology Foundation
22
// SPDX-License-Identifier: Apache-2.0
3-
apply plugin: 'com.android.application'
4-
apply plugin: 'project-report'
3+
plugins {
4+
id("com.android.application")
5+
id("project-report")
6+
}
57

68
android {
79
compileSdkVersion 28
@@ -18,12 +20,12 @@ android {
1820
targetCompatibility JavaVersion.VERSION_1_8
1921
}
2022
packagingOptions {
21-
merge 'META-INF/annotations/*'
23+
merge "META-INF/annotations/*"
2224
}
2325
buildTypes {
2426
release {
2527
minifyEnabled false
26-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
28+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
2729
}
2830
}
2931
lintOptions {
@@ -32,21 +34,21 @@ android {
3234
}
3335

3436
dependencies {
35-
implementation fileTree(dir: 'libs', include: ['*.jar'])
36-
implementation 'com.android.support:appcompat-v7:28.0.0'
37-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
38-
implementation project(':gestalt-android')
39-
implementation project(':gestalt-asset-core')
40-
implementation project(":gestalt-entity-system")
41-
implementation "com.google.guava:guava:$guava_version"
42-
implementation "org.slf4j:slf4j-api:$slf4j_version"
43-
implementation 'com.github.tony19:logback-android:1.3.0-3'
44-
implementation project(':testpack:testpack-api')
45-
testImplementation "junit:junit:$junit_version"
46-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
47-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
37+
implementation(fileTree(dir: "libs", include: ["*.jar"]))
38+
implementation("com.android.support:appcompat-v7:28.0.0")
39+
implementation("com.android.support.constraint:constraint-layout:1.1.3")
40+
implementation(project(":gestalt-android"))
41+
implementation(project(":gestalt-asset-core"))
42+
implementation(project(":gestalt-entity-system"))
43+
implementation(libs.guava)
44+
implementation(libs.slf4j.api)
45+
implementation("com.github.tony19:logback-android:1.3.0-3")
46+
implementation(project(":testpack:testpack-api"))
47+
testImplementation(libs.junit)
48+
androidTestImplementation("com.android.support.test:runner:1.0.2")
49+
androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2")
4850

49-
annotationProcessor project(":gestalt-inject-java")
51+
annotationProcessor(project(":gestalt-inject-java"))
5052
}
5153

5254
// Android projects don't provide direct access to compileJava but this seems to work.

gestalt-android/build.gradle

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2021 The Terasology Foundation
22
// SPDX-License-Identifier: Apache-2.0
33
plugins {
4-
id 'com.android.library'
5-
id 'maven-publish'
4+
id("com.android.library")
5+
id("maven-publish")
66
}
77

88
android {
@@ -23,7 +23,7 @@ android {
2323
buildTypes {
2424
release {
2525
minifyEnabled false
26-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
2727
}
2828
}
2929
lintOptions {
@@ -33,46 +33,46 @@ android {
3333
}
3434

3535
dependencies {
36-
implementation fileTree(dir: 'libs', include: ['*.jar'])
37-
api(project(':gestalt-module')) {
38-
exclude group: 'org.javassist', module: 'javassist'
36+
implementation(fileTree(dir: "libs", include: ["*.jar"]))
37+
api(project(":gestalt-module")) {
38+
exclude group: "org.javassist", module: "javassist"
3939
}
40-
implementation project(':gestalt-util')
41-
implementation "org.slf4j:slf4j-api:$slf4j_version"
42-
implementation "com.google.guava:guava:$guava_version"
43-
44-
implementation 'com.android.support:appcompat-v7:28.0.0'
45-
testImplementation "junit:junit:$junit_version"
46-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
47-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
40+
implementation(project(":gestalt-util"))
41+
implementation(libs.slf4j.api)
42+
implementation(libs.guava)
43+
44+
implementation("com.android.support:appcompat-v7:28.0.0")
45+
testImplementation(libs.junit)
46+
androidTestImplementation("com.android.support.test:runner:1.0.2")
47+
androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2")
4848
}
4949

5050
task androidJavadocs(type: Javadoc) {
5151
source = android.sourceSets.main.java.srcDirs
5252
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
5353
android.libraryVariants.all { variant ->
54-
if (variant.name == 'release') {
54+
if (variant.name == "release") {
5555
owner.classpath += variant.javaCompileProvider.get().classpath
5656
}
5757
}
58-
exclude '**/R.html', '**/R.*.html', '**/index.html'
58+
exclude "**/R.html", "**/R.*.html", "**/index.html"
5959
}
6060

6161
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
62-
archiveClassifier = 'javadoc'
62+
archiveClassifier = "javadoc"
6363
from androidJavadocs.destinationDir
6464
}
6565

6666
task androidSourcesJar(type: Jar) {
67-
archiveClassifier = 'sources'
67+
archiveClassifier = "sources"
6868
from android.sourceSets.main.java.srcDirs
6969
}
7070

7171
project.afterEvaluate {
7272
publishing {
7373
repositories {
7474
maven {
75-
name = 'TerasologyOrg'
75+
name = "TerasologyOrg"
7676

7777
if (rootProject.hasProperty("publishRepo")) {
7878
// This first option is good for local testing, you can set a full explicit target repo in gradle.properties
@@ -88,7 +88,7 @@ project.afterEvaluate {
8888
}
8989

9090
// Base final publish repo on whether we're building a snapshot or a release
91-
if (project.version.endsWith('SNAPSHOT')) {
91+
if (project.version.endsWith("SNAPSHOT")) {
9292
deducedPublishRepo += "-snapshot-local"
9393
} else {
9494
deducedPublishRepo += "-release-local"
@@ -119,29 +119,29 @@ project.afterEvaluate {
119119
artifact androidSourcesJar
120120

121121
pom.withXml {
122-
final dependenciesNode = asNode().appendNode('dependencies')
122+
final dependenciesNode = asNode().appendNode("dependencies")
123123

124124
ext.addDependency = { Dependency dep, String scope ->
125125
if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified")
126126
return // ignore invalid dependencies
127127

128-
final dependencyNode = dependenciesNode.appendNode('dependency')
129-
dependencyNode.appendNode('groupId', dep.group)
130-
dependencyNode.appendNode('artifactId', dep.name)
131-
dependencyNode.appendNode('version', dep.version)
132-
dependencyNode.appendNode('scope', scope)
128+
final dependencyNode = dependenciesNode.appendNode("dependency")
129+
dependencyNode.appendNode("groupId", dep.group)
130+
dependencyNode.appendNode("artifactId", dep.name)
131+
dependencyNode.appendNode("version", dep.version)
132+
dependencyNode.appendNode("scope", scope)
133133

134134
if (!dep.transitive) {
135135
// If this dependency is transitive, we should force exclude all its dependencies them from the POM
136-
final exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion')
137-
exclusionNode.appendNode('groupId', '*')
138-
exclusionNode.appendNode('artifactId', '*')
136+
final exclusionNode = dependencyNode.appendNode("exclusions").appendNode("exclusion")
137+
exclusionNode.appendNode("groupId", "*")
138+
exclusionNode.appendNode("artifactId", "*")
139139
} else if (!dep.properties.excludeRules.empty) {
140140
// Otherwise add specified exclude rules
141-
final exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion')
141+
final exclusionNode = dependencyNode.appendNode("exclusions").appendNode("exclusion")
142142
dep.properties.excludeRules.each { ExcludeRule rule ->
143-
exclusionNode.appendNode('groupId', rule.group ?: '*')
144-
exclusionNode.appendNode('artifactId', rule.module ?: '*')
143+
exclusionNode.appendNode("groupId", rule.group ?: "*")
144+
exclusionNode.appendNode("artifactId", rule.module ?: "*")
145145
}
146146
}
147147
}

gestalt-asset-core/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ apply from: "$rootDir/gradle/common.gradle"
44

55
// Primary dependencies definition
66
dependencies {
7-
implementation project(":gestalt-util")
8-
implementation project(":gestalt-module")
9-
implementation project(":gestalt-inject")
10-
annotationProcessor project(":gestalt-inject-java")
7+
implementation(project(":gestalt-util"))
8+
implementation(project(":gestalt-module"))
9+
implementation(project(":gestalt-inject"))
10+
annotationProcessor(project(":gestalt-inject-java"))
1111

12-
implementation "com.google.guava:guava:$guava_version"
13-
implementation "org.slf4j:slf4j-api:$slf4j_version"
14-
implementation "com.android.support:support-annotations:$android_annotation_version"
15-
api "net.jcip:jcip-annotations:$jcip_annotation_version"
12+
implementation(libs.guava)
13+
implementation(libs.slf4j.api)
14+
implementation(libs.android.annotation)
15+
api(libs.jcip)
1616

17-
testAnnotationProcessor project(":gestalt-inject-java")
18-
testImplementation "junit:junit:$junit_version"
19-
testImplementation "ch.qos.logback:logback-classic:$logback_version"
20-
testImplementation "org.mockito:mockito-core:$mockito_version"
17+
testAnnotationProcessor(project(":gestalt-inject-java"))
18+
testImplementation(libs.junit)
19+
testImplementation(libs.logback)
20+
testImplementation(libs.mockito)
2121
}
2222

2323
compileJava {

gestalt-di/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ task gatherJarModules(dependsOn: [':testpack:moduleA:jar', ':testpack:moduleB:ja
66

77
// Primary dependencies definition
88
dependencies {
9-
testAnnotationProcessor project(":gestalt-inject-java")
9+
testAnnotationProcessor(project(":gestalt-inject-java"))
1010

11-
implementation "org.slf4j:slf4j-api:$slf4j_version"
12-
implementation "com.google.guava:guava:$guava_version"
13-
api project(":gestalt-inject")
11+
implementation(libs.slf4j.api)
12+
implementation(libs.guava)
13+
api(project(":gestalt-inject"))
1414

15-
testImplementation "junit:junit:$junit_version"
16-
testImplementation "ch.qos.logback:logback-classic:$logback_version"
17-
testImplementation "org.mockito:mockito-core:$mockito_version"
15+
testImplementation(libs.junit)
16+
testImplementation(libs.logback)
17+
testImplementation(libs.mockito)
1818

19-
testImplementation project(":gestalt-module")
20-
testImplementation project(":testpack:testpack-api")
21-
testImplementation project(":gestalt-entity-system")
19+
testImplementation(project(":gestalt-module"))
20+
testImplementation(project(":testpack:testpack-api"))
21+
testImplementation(project(":gestalt-entity-system"))
2222
}
2323

2424
gatherJarModules {

gestalt-entity-system/build.gradle

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ apply from: "$rootDir/gradle/common.gradle"
44

55
// Primary dependencies definition
66
dependencies {
7-
implementation project(":gestalt-util")
8-
implementation project(":gestalt-module")
9-
implementation project(":gestalt-asset-core")
10-
implementation project(":gestalt-inject")
11-
annotationProcessor project(":gestalt-inject-java")
7+
implementation(project(":gestalt-util"))
8+
implementation(project(":gestalt-module"))
9+
implementation(project(":gestalt-asset-core"))
10+
implementation(project(":gestalt-inject"))
11+
annotationProcessor(project(":gestalt-inject-java"))
1212

13-
implementation "com.google.guava:guava:$guava_version"
14-
implementation "org.slf4j:slf4j-api:$slf4j_version"
15-
implementation "com.android.support:support-annotations:$android_annotation_version"
16-
implementation "net.jcip:jcip-annotations:$jcip_annotation_version"
17-
implementation 'net.sf.trove4j:trove4j:3.0.3'
18-
implementation "com.google.code.gson:gson:$gson_version"
13+
implementation(libs.guava)
14+
implementation(libs.slf4j.api)
15+
implementation(libs.android.annotation)
16+
implementation(libs.jcip)
17+
implementation("net.sf.trove4j:trove4j:3.0.3")
18+
implementation(libs.gson)
1919

20-
testAnnotationProcessor project(":gestalt-inject-java")
21-
testImplementation "junit:junit:$junit_version"
22-
testImplementation "ch.qos.logback:logback-classic:$logback_version"
23-
testImplementation "org.mockito:mockito-core:$mockito_version"
20+
testAnnotationProcessor(project(":gestalt-inject-java"))
21+
testImplementation(libs.junit)
22+
testImplementation(libs.logback)
23+
testImplementation(libs.mockito)
2424
}
2525

2626
compileJava {

gestalt-es-perf/build.gradle

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ apply from: "$rootDir/gradle/common.gradle"
44

55
// Primary dependencies definition
66
dependencies {
7-
implementation project(":gestalt-util")
8-
implementation project(":gestalt-module")
9-
implementation project(":gestalt-asset-core")
10-
implementation project(":gestalt-entity-system")
11-
12-
implementation "com.google.guava:guava:$guava_version"
13-
implementation "org.slf4j:slf4j-api:$slf4j_version"
14-
implementation "com.android.support:support-annotations:$android_annotation_version"
15-
implementation "net.jcip:jcip-annotations:$jcip_annotation_version"
16-
17-
testImplementation "junit:junit:$junit_version"
18-
testImplementation "ch.qos.logback:logback-classic:$logback_version"
19-
testImplementation "org.mockito:mockito-core:$mockito_version"
7+
implementation(project(":gestalt-util"))
8+
implementation(project(":gestalt-module"))
9+
implementation(project(":gestalt-asset-core"))
10+
implementation(project(":gestalt-entity-system"))
11+
12+
implementation(libs.guava)
13+
implementation(libs.slf4j.api)
14+
implementation(libs.android.annotation)
15+
implementation(libs.jcip)
16+
17+
testImplementation(libs.junit)
18+
testImplementation(libs.logback)
19+
testImplementation(libs.mockito)
2020
}
2121

22-
description = 'High performance access methods to replace the use of reflections in gestalt-entity-system. Can be used in Java 7+ and Android API 26+.'
22+
description = "High performance access methods to replace the use of reflections in gestalt-entity-system. Can be used in Java 7+ and Android API 26+."
2323

2424
/***
2525
* Testpack inclusion

gestalt-inject-java/build.gradle

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ apply from: "$rootDir/gradle/common.gradle"
44

55
// Primary dependencies definition
66
dependencies {
7-
implementation project(":gestalt-util")
8-
implementation "com.google.guava:guava:$guava_version"
9-
implementation "com.google.code.gson:gson:$gson_version"
10-
implementation 'org.apache.commons:commons-vfs2:2.2'
11-
implementation "org.slf4j:slf4j-api:$slf4j_version"
12-
implementation "com.android.support:support-annotations:$android_annotation_version"
13-
implementation "com.github.zafarkhaja:java-semver:0.10.2"
7+
implementation(project(":gestalt-util"))
8+
implementation(libs.guava)
9+
implementation(libs.gson)
10+
implementation("org.apache.commons:commons-vfs2:2.2")
11+
implementation(libs.slf4j.api)
12+
implementation(libs.android.annotation)
13+
implementation("com.github.zafarkhaja:java-semver:0.10.2")
1414

15-
testImplementation project(":testpack:testpack-api")
16-
testImplementation "junit:junit:$junit_version"
17-
testImplementation "ch.qos.logback:logback-classic:$logback_version"
18-
testImplementation "org.mockito:mockito-core:$mockito_version"
15+
testImplementation(project(":testpack:testpack-api"))
16+
testImplementation(libs.junit)
17+
testImplementation(libs.logback)
18+
testImplementation(libs.mockito)
1919

20-
implementation 'com.squareup:javapoet:1.12.0'
21-
implementation group: 'javax.inject', name: 'javax.inject', version: '1'
22-
implementation project(":gestalt-inject");
20+
implementation("com.squareup:javapoet:1.12.0")
21+
implementation(group: "javax.inject", name: "javax.inject", version: "1")
22+
implementation(project(":gestalt-inject"))
2323
}

0 commit comments

Comments
 (0)