Skip to content

Commit a7968fe

Browse files
authored
ci: bump minor version to 7.1, add Jenkinsfile to release snapshot (#106)
and assorted changes to gradle config to reduce duplication and bring it inline with other Terasology-managed libraries.
2 parents d97b8f7 + 7694e94 commit a7968fe

File tree

19 files changed

+228
-411
lines changed

19 files changed

+228
-411
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*.war
1414
*.ear
1515
/gestalt-module/test-modules/*
16+
/gestalt-es-perf/test-modules/*
1617

1718
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
1819
hs_err_pid*

Jenkinsfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
pipeline {
2+
agent {
3+
label "java8"
4+
}
5+
stages {
6+
stage('Build') {
7+
steps {
8+
sh './gradlew --info --console=plain --parallel assemble compileTest'
9+
}
10+
post {
11+
always {
12+
recordIssues enabledForFailure: true, tools: [java()]
13+
}
14+
}
15+
}
16+
stage('Analytics') {
17+
steps {
18+
// `test` seems flaky when run with --parallel, so separate it from other checks
19+
sh './gradlew --info --console=plain --continue test'
20+
sh './gradlew --info --console=plain --parallel --continue javadoc check --exclude-task test'
21+
}
22+
post {
23+
always {
24+
junit testResults: '**/build/test-results/test/*.xml'
25+
recordIssues tools: [
26+
javaDoc(),
27+
taskScanner(includePattern: '**/*.java,**/*.groovy,**/*.gradle,**/*.kts', lowTags: 'WIBNIF', normalTags: 'TODO, FIXME', highTags: 'ASAP')
28+
]
29+
//Note: Javadoc archiver only works for one directory :-(
30+
javadoc javadocDir: 'gestalt-entity-system/build/docs/javadoc', keepAll: false
31+
}
32+
}
33+
}
34+
stage('Publish') {
35+
when {
36+
anyOf {
37+
branch 'develop'
38+
branch pattern: "release/v\\d+.x", comparator: "REGEXP"
39+
}
40+
}
41+
steps {
42+
withCredentials([usernamePassword(credentialsId: 'artifactory-gooey', usernameVariable: 'artifactoryUser', passwordVariable: 'artifactoryPass')]) {
43+
sh './gradlew --info --console=plain -Dorg.gradle.internal.publish.checksums.insecure=true publish -PmavenUser=${artifactoryUser} -PmavenPass=${artifactoryPass}'
44+
}
45+
}
46+
}
47+
}
48+
}

build.gradle

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
// Copyright 2021 The Terasology Foundation
22
// SPDX-License-Identifier: Apache-2.0
3-
4-
/*
5-
* This is a Gradle build file:
6-
* - Gradle Homepage: http://gradle.org/
7-
* - Gradle Documentation: http://gradle.org/documentation
8-
* - View tasks for this project: $ gradlew tasks
9-
*/
10-
113
buildscript {
124
repositories {
135
google()
@@ -26,39 +18,51 @@ buildscript {
2618
}
2719
dependencies {
2820
classpath 'com.android.tools.build:gradle:3.5.3'
29-
classpath 'org.terasology:reflections:0.9.12-MB'
30-
// NOTE: Do not place your application dependencies here; they belong
31-
// in the individual module build.gradle files
21+
classpath 'org.terasology:reflections:0.9.12-MB' // This goes away in v8
3222
}
33-
ext {
34-
// Android version support
35-
android_annotation_version = "28.0.0"
23+
}
3624

37-
// Standard Utility
38-
guava_version = "27.0.1-android"
39-
slf4j_version = "1.7.25"
40-
gson_version = "2.8.5"
41-
jcip_annotation_version = "1.0"
25+
ext {
26+
// Android version support
27+
android_annotation_version = "28.0.0"
4228

43-
// Testing
44-
junit_version = "4.13.2"
45-
jupiter_version = "5.7.1"
46-
logback_version = "1.2.3"
47-
mockito_version = "3.7.7"
48-
}
29+
// Standard Utility
30+
guava_version = "27.0.1-android"
31+
slf4j_version = "1.7.25"
32+
gson_version = "2.8.5"
33+
jcip_annotation_version = "1.0"
34+
35+
// Testing
36+
junit_version = "4.13.2"
37+
jupiter_version = "5.7.1"
38+
logback_version = "1.2.3"
39+
mockito_version = "3.7.7"
4940
}
5041

5142
allprojects {
5243
repositories {
5344
google()
5445
mavenCentral()
55-
// org.jetbrains.trove4j:trove4j
56-
gradlePluginPortal()
46+
47+
// Terasology Artifactory instance for libs not readily available elsewhere plus our own libs
5748
maven {
58-
name = "Terasology Artifactory"
59-
url = "http://artifactory.terasology.org/artifactory/libs-release-local"
60-
allowInsecureProtocol = true // 😱
49+
def repoViaEnv = System.getenv()["RESOLUTION_REPO"]
50+
if (rootProject.hasProperty("alternativeResolutionRepo")) {
51+
// If the user supplies an alternative repo via gradle.properties then use that
52+
name "from alternativeResolutionRepo property"
53+
url alternativeResolutionRepo
54+
} else if (repoViaEnv != null && repoViaEnv != "") {
55+
name "from \$RESOLUTION_REPO"
56+
url = repoViaEnv
57+
} else {
58+
// Our default is the main virtual repo containing everything except repos for testing Artifactory itself
59+
name "Terasology Artifactory"
60+
url "http://artifactory.terasology.org/artifactory/virtual-repo-live"
61+
allowInsecureProtocol true // 😱
62+
}
6163
}
64+
65+
// SemVer lib
6266
maven {
6367
url 'https://heisluft.de/maven'
6468
}
@@ -71,5 +75,3 @@ description = 'A set of libraries providing core capabilities for games and game
7175
task clean(type: Delete) {
7276
delete rootProject.buildDir
7377
}
74-
75-

gestalt-android-testbed/build.gradle

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
1-
/*
2-
* Copyright 2019 MovingBlocks
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
1+
// Copyright 2021 The Terasology Foundation
2+
// SPDX-License-Identifier: Apache-2.0
173
import com.google.common.base.Predicate
184
import org.reflections.Reflections
195
import org.reflections.scanners.ResourcesScanner

gestalt-android/build.gradle

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2021 The Terasology Foundation
22
// SPDX-License-Identifier: Apache-2.0
3-
43
apply plugin: 'com.android.library'
54
apply plugin: 'maven-publish'
65

@@ -70,13 +69,42 @@ project.afterEvaluate {
7069
publishing {
7170
repositories {
7271
maven {
73-
credentials {
74-
username project.gestaltMavenRepoUsername
75-
password project.gestaltMavenRepoPassword
72+
name = 'TerasologyOrg'
73+
allowInsecureProtocol true // 😱 - no https on our Artifactory yet
74+
75+
if (rootProject.hasProperty("publishRepo")) {
76+
// This first option is good for local testing, you can set a full explicit target repo in gradle.properties
77+
url = "http://artifactory.terasology.org/artifactory/$publishRepo"
78+
79+
logger.info("Changing PUBLISH repoKey set via Gradle property to {}", publishRepo)
80+
} else {
81+
// Support override from the environment to use a different target publish org
82+
String deducedPublishRepo = System.getenv()["PUBLISH_ORG"]
83+
if (deducedPublishRepo == null || deducedPublishRepo == "") {
84+
// If not then default
85+
deducedPublishRepo = "libs"
86+
}
87+
88+
// Base final publish repo on whether we're building a snapshot or a release
89+
if (project.version.endsWith('SNAPSHOT')) {
90+
deducedPublishRepo += "-snapshot-local"
91+
} else {
92+
deducedPublishRepo += "-release-local"
93+
}
94+
95+
logger.info("The final deduced publish repo is {}", deducedPublishRepo)
96+
url = "http://artifactory.terasology.org/artifactory/$deducedPublishRepo"
97+
}
98+
99+
if (rootProject.hasProperty("mavenUser") && rootProject.hasProperty("mavenPass")) {
100+
credentials {
101+
username = "$mavenUser"
102+
password = "$mavenPass"
103+
}
104+
authentication {
105+
basic(BasicAuthentication)
106+
}
76107
}
77-
name 'TerasologyTestRepo'
78-
allowInsecureProtocol = true // 😱
79-
url project.version.endsWith('SNAPSHOT') ? project.snapshotPublishRepo : project.releasePublishRepo
80108
}
81109
}
82110
publications {

gestalt-asset-core/build.gradle

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
// Copyright 2021 The Terasology Foundation
22
// SPDX-License-Identifier: Apache-2.0
3-
4-
/*
5-
* This is a Gradle build file:
6-
* - Gradle Homepage: http://gradle.org/
7-
* - Gradle Documentation: http://gradle.org/documentation
8-
* - View tasks for this project: $ gradlew tasks
9-
*/
10-
11-
apply plugin: 'java-library'
12-
apply plugin: 'maven-publish'
3+
apply from: "$rootDir/gradle/common.gradle"
134

145
// Primary dependencies definition
156
dependencies {
@@ -33,48 +24,6 @@ dependencies {
3324

3425
description = 'Provides support for assets - binary resources that can be loaded from modules or procedurally generated at runtime.'
3526

36-
sourceCompatibility = 1.8
37-
targetCompatibility = 1.8
38-
3927
tasks.named("test", Test) {
4028
useJUnitPlatform()
4129
}
42-
43-
/***
44-
* Publishing
45-
***/
46-
47-
task sourceJar(type: Jar, dependsOn: classes) {
48-
classifier 'sources'
49-
from sourceSets.main.allSource
50-
}
51-
52-
task javadocJar(type: Jar, dependsOn: javadoc) {
53-
classifier = 'javadoc'
54-
from javadoc.destinationDir
55-
}
56-
57-
publishing {
58-
repositories {
59-
maven {
60-
credentials {
61-
username project.gestaltMavenRepoUsername
62-
password project.gestaltMavenRepoPassword
63-
}
64-
name 'TerasologyTestRepo'
65-
allowInsecureProtocol = true // 😱
66-
url project.version.endsWith('SNAPSHOT') ? project.snapshotPublishRepo : project.releasePublishRepo
67-
}
68-
}
69-
publications {
70-
mavenAssetCore(MavenPublication) {
71-
artifactId = project.name
72-
version = project.version
73-
74-
from components.java
75-
76-
artifact sourceJar
77-
artifact javadocJar
78-
}
79-
}
80-
}

gestalt-entity-system/build.gradle

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
// Copyright 2021 The Terasology Foundation
22
// SPDX-License-Identifier: Apache-2.0
3-
4-
/*
5-
* This is a Gradle build file:
6-
* - Gradle Homepage: http://gradle.org/
7-
* - Gradle Documentation: http://gradle.org/documentation
8-
* - View tasks for this project: $ gradlew tasks
9-
*/
10-
11-
apply plugin: 'java-library'
12-
apply plugin: 'maven-publish'
3+
apply from: "$rootDir/gradle/common.gradle"
134

145
// Primary dependencies definition
156
dependencies {
@@ -34,61 +25,9 @@ dependencies {
3425
testImplementation("org.mockito:mockito-junit-jupiter:$mockito_version")
3526
}
3627

37-
buildscript {
38-
repositories {
39-
mavenCentral()
40-
}
41-
dependencies {
42-
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"
43-
}
44-
}
45-
4628
description = 'A threadsafe entity system implementation. ' +
4729
'An entity system is a component based data model.'
4830

49-
sourceCompatibility = 1.8
50-
targetCompatibility = 1.8
51-
5231
tasks.named("test", Test) {
5332
useJUnitPlatform()
5433
}
55-
56-
/***
57-
* Publishing
58-
***/
59-
60-
task sourceJar(type: Jar, dependsOn: classes) {
61-
classifier 'sources'
62-
from sourceSets.main.allSource
63-
}
64-
65-
task javadocJar(type: Jar, dependsOn: javadoc) {
66-
classifier = 'javadoc'
67-
from javadoc.destinationDir
68-
}
69-
70-
publishing {
71-
repositories {
72-
maven {
73-
credentials {
74-
username project.gestaltMavenRepoUsername
75-
password project.gestaltMavenRepoPassword
76-
}
77-
name 'TerasologyTestRepo'
78-
allowInsecureProtocol = true // 😱
79-
url project.version.endsWith('SNAPSHOT') ? project.snapshotPublishRepo : project.releasePublishRepo
80-
}
81-
}
82-
publications {
83-
mavenEs(MavenPublication) {
84-
artifactId = project.name
85-
version = project.version
86-
87-
from components.java
88-
89-
artifact sourceJar
90-
artifact javadocJar
91-
}
92-
}
93-
}
94-

0 commit comments

Comments
 (0)