Skip to content

Commit

Permalink
ci: bump minor version to 7.1, add Jenkinsfile to release snapshot (#106
Browse files Browse the repository at this point in the history
)

and assorted changes to gradle config to reduce duplication and bring it inline with other Terasology-managed libraries.
  • Loading branch information
keturn authored Apr 25, 2021
2 parents d97b8f7 + 7694e94 commit a7968fe
Show file tree
Hide file tree
Showing 19 changed files with 228 additions and 411 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*.war
*.ear
/gestalt-module/test-modules/*
/gestalt-es-perf/test-modules/*

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
Expand Down
48 changes: 48 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
pipeline {
agent {
label "java8"
}
stages {
stage('Build') {
steps {
sh './gradlew --info --console=plain --parallel assemble compileTest'
}
post {
always {
recordIssues enabledForFailure: true, tools: [java()]
}
}
}
stage('Analytics') {
steps {
// `test` seems flaky when run with --parallel, so separate it from other checks
sh './gradlew --info --console=plain --continue test'
sh './gradlew --info --console=plain --parallel --continue javadoc check --exclude-task test'
}
post {
always {
junit testResults: '**/build/test-results/test/*.xml'
recordIssues tools: [
javaDoc(),
taskScanner(includePattern: '**/*.java,**/*.groovy,**/*.gradle,**/*.kts', lowTags: 'WIBNIF', normalTags: 'TODO, FIXME', highTags: 'ASAP')
]
//Note: Javadoc archiver only works for one directory :-(
javadoc javadocDir: 'gestalt-entity-system/build/docs/javadoc', keepAll: false
}
}
}
stage('Publish') {
when {
anyOf {
branch 'develop'
branch pattern: "release/v\\d+.x", comparator: "REGEXP"
}
}
steps {
withCredentials([usernamePassword(credentialsId: 'artifactory-gooey', usernameVariable: 'artifactoryUser', passwordVariable: 'artifactoryPass')]) {
sh './gradlew --info --console=plain -Dorg.gradle.internal.publish.checksums.insecure=true publish -PmavenUser=${artifactoryUser} -PmavenPass=${artifactoryPass}'
}
}
}
}
}
66 changes: 34 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

/*
* This is a Gradle build file:
* - Gradle Homepage: http://gradle.org/
* - Gradle Documentation: http://gradle.org/documentation
* - View tasks for this project: $ gradlew tasks
*/

buildscript {
repositories {
google()
Expand All @@ -26,39 +18,51 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'org.terasology:reflections:0.9.12-MB'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'org.terasology:reflections:0.9.12-MB' // This goes away in v8
}
ext {
// Android version support
android_annotation_version = "28.0.0"
}

// Standard Utility
guava_version = "27.0.1-android"
slf4j_version = "1.7.25"
gson_version = "2.8.5"
jcip_annotation_version = "1.0"
ext {
// Android version support
android_annotation_version = "28.0.0"

// Testing
junit_version = "4.13.2"
jupiter_version = "5.7.1"
logback_version = "1.2.3"
mockito_version = "3.7.7"
}
// Standard Utility
guava_version = "27.0.1-android"
slf4j_version = "1.7.25"
gson_version = "2.8.5"
jcip_annotation_version = "1.0"

// Testing
junit_version = "4.13.2"
jupiter_version = "5.7.1"
logback_version = "1.2.3"
mockito_version = "3.7.7"
}

allprojects {
repositories {
google()
mavenCentral()
// org.jetbrains.trove4j:trove4j
gradlePluginPortal()

// Terasology Artifactory instance for libs not readily available elsewhere plus our own libs
maven {
name = "Terasology Artifactory"
url = "http://artifactory.terasology.org/artifactory/libs-release-local"
allowInsecureProtocol = true // 😱
def repoViaEnv = System.getenv()["RESOLUTION_REPO"]
if (rootProject.hasProperty("alternativeResolutionRepo")) {
// If the user supplies an alternative repo via gradle.properties then use that
name "from alternativeResolutionRepo property"
url alternativeResolutionRepo
} else if (repoViaEnv != null && repoViaEnv != "") {
name "from \$RESOLUTION_REPO"
url = repoViaEnv
} else {
// Our default is the main virtual repo containing everything except repos for testing Artifactory itself
name "Terasology Artifactory"
url "http://artifactory.terasology.org/artifactory/virtual-repo-live"
allowInsecureProtocol true // 😱
}
}

// SemVer lib
maven {
url 'https://heisluft.de/maven'
}
Expand All @@ -71,5 +75,3 @@ description = 'A set of libraries providing core capabilities for games and game
task clean(type: Delete) {
delete rootProject.buildDir
}


18 changes: 2 additions & 16 deletions gestalt-android-testbed/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
/*
* Copyright 2019 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
import com.google.common.base.Predicate
import org.reflections.Reflections
import org.reflections.scanners.ResourcesScanner
Expand Down
42 changes: 35 additions & 7 deletions gestalt-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

Expand Down Expand Up @@ -70,13 +69,42 @@ project.afterEvaluate {
publishing {
repositories {
maven {
credentials {
username project.gestaltMavenRepoUsername
password project.gestaltMavenRepoPassword
name = 'TerasologyOrg'
allowInsecureProtocol true // 😱 - no https on our Artifactory yet

if (rootProject.hasProperty("publishRepo")) {
// This first option is good for local testing, you can set a full explicit target repo in gradle.properties
url = "http://artifactory.terasology.org/artifactory/$publishRepo"

logger.info("Changing PUBLISH repoKey set via Gradle property to {}", publishRepo)
} else {
// Support override from the environment to use a different target publish org
String deducedPublishRepo = System.getenv()["PUBLISH_ORG"]
if (deducedPublishRepo == null || deducedPublishRepo == "") {
// If not then default
deducedPublishRepo = "libs"
}

// Base final publish repo on whether we're building a snapshot or a release
if (project.version.endsWith('SNAPSHOT')) {
deducedPublishRepo += "-snapshot-local"
} else {
deducedPublishRepo += "-release-local"
}

logger.info("The final deduced publish repo is {}", deducedPublishRepo)
url = "http://artifactory.terasology.org/artifactory/$deducedPublishRepo"
}

if (rootProject.hasProperty("mavenUser") && rootProject.hasProperty("mavenPass")) {
credentials {
username = "$mavenUser"
password = "$mavenPass"
}
authentication {
basic(BasicAuthentication)
}
}
name 'TerasologyTestRepo'
allowInsecureProtocol = true // 😱
url project.version.endsWith('SNAPSHOT') ? project.snapshotPublishRepo : project.releasePublishRepo
}
}
publications {
Expand Down
53 changes: 1 addition & 52 deletions gestalt-asset-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

/*
* This is a Gradle build file:
* - Gradle Homepage: http://gradle.org/
* - Gradle Documentation: http://gradle.org/documentation
* - View tasks for this project: $ gradlew tasks
*/

apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply from: "$rootDir/gradle/common.gradle"

// Primary dependencies definition
dependencies {
Expand All @@ -33,48 +24,6 @@ dependencies {

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

sourceCompatibility = 1.8
targetCompatibility = 1.8

tasks.named("test", Test) {
useJUnitPlatform()
}

/***
* Publishing
***/

task sourceJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

publishing {
repositories {
maven {
credentials {
username project.gestaltMavenRepoUsername
password project.gestaltMavenRepoPassword
}
name 'TerasologyTestRepo'
allowInsecureProtocol = true // 😱
url project.version.endsWith('SNAPSHOT') ? project.snapshotPublishRepo : project.releasePublishRepo
}
}
publications {
mavenAssetCore(MavenPublication) {
artifactId = project.name
version = project.version

from components.java

artifact sourceJar
artifact javadocJar
}
}
}
63 changes: 1 addition & 62 deletions gestalt-entity-system/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

/*
* This is a Gradle build file:
* - Gradle Homepage: http://gradle.org/
* - Gradle Documentation: http://gradle.org/documentation
* - View tasks for this project: $ gradlew tasks
*/

apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply from: "$rootDir/gradle/common.gradle"

// Primary dependencies definition
dependencies {
Expand All @@ -34,61 +25,9 @@ dependencies {
testImplementation("org.mockito:mockito-junit-jupiter:$mockito_version")
}

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"
}
}

description = 'A threadsafe entity system implementation. ' +
'An entity system is a component based data model.'

sourceCompatibility = 1.8
targetCompatibility = 1.8

tasks.named("test", Test) {
useJUnitPlatform()
}

/***
* Publishing
***/

task sourceJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

publishing {
repositories {
maven {
credentials {
username project.gestaltMavenRepoUsername
password project.gestaltMavenRepoPassword
}
name 'TerasologyTestRepo'
allowInsecureProtocol = true // 😱
url project.version.endsWith('SNAPSHOT') ? project.snapshotPublishRepo : project.releasePublishRepo
}
}
publications {
mavenEs(MavenPublication) {
artifactId = project.name
version = project.version

from components.java

artifact sourceJar
artifact javadocJar
}
}
}

Loading

0 comments on commit a7968fe

Please sign in to comment.