Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): clean up gradle deprecations #46

Merged
merged 7 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 22 additions & 30 deletions cr-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

plugins {
id "org.standardout.versioneye" version "1.3.0"
id "com.github.spotbugs" version "4.6.0"
id "java-library"
id "eclipse"
id "idea"
Comment on lines +8 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know those are just here because they were present before - but do we still need them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eclipse: no idea. it does seem like it's been years since any of us have tried to support an eclipse workspace.

idea: given we don't have any idea { } customizations in this file, maybe not? haven't checked.

id "checkstyle"
id "pmd"
id "maven-publish"
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'maven-publish'

apply from: "$rootDir/gradle/common.gradle"

// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

import java.text.SimpleDateFormat;

def env = System.getenv()
def versionInfoFile = new File(sourceSets.main.output.resourcesDir, 'versionInfo.properties')

Expand Down Expand Up @@ -46,6 +42,7 @@ repositories {
maven {
name "Terasology Artifactory"
url "http://artifactory.terasology.org:8081/artifactory/virtual-repo-live"
allowInsecureProtocol true // 😱
}
}

Expand All @@ -61,19 +58,19 @@ dependencies {
pmd ('net.sourceforge.pmd:pmd-core:5.4.1')
pmd ('net.sourceforge.pmd:pmd-java:5.4.1')

compile group: 'org', name: 'jpastebin', version: '1.0.1'
compile group: 'org.apache.httpcomponents', name: 'httpcomponents-client', version: '4.5.2'
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.2'
implementation group: 'org', name: 'jpastebin', version: '1.0.1'
implementation group: 'org.apache.httpcomponents', name: 'httpcomponents-client', version: '4.5.2'
implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.2'

testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
testCompile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
testImplementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21'

testRuntime group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.7'
testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.7'

compile group: 'com.google.guava', name: 'guava', version: '19.0'
implementation group: 'com.google.guava', name: 'guava', version: '19.0'

compile ('com.google.apis:google-api-services-drive:v2-rev193-1.20.0') {
implementation ('com.google.apis:google-api-services-drive:v2-rev193-1.20.0') {
// This exclusion avoids a dependency clash against newer versions of Guava in projects using the CR
exclude module: 'guava-jdk5'

Expand All @@ -87,11 +84,8 @@ dependencies {

// But on the other hand to be able to run the unit tests successfully while embedded we still do need this
if (rootProject.name == "Terasology") {
testCompile group: 'com.google.http-client', name: 'google-http-client-jackson2', version: '1.20.0'
testImplementation group: 'com.google.http-client', name: 'google-http-client-jackson2', version: '1.20.0'
}

//compile 'com.google.oauth-client:google-oauth-client-java6:1.19.0'
//compile 'com.google.oauth-client:google-oauth-client-jetty:1.19.0'
}

def convertGitBranch = { gitBranch ->
Expand Down Expand Up @@ -123,13 +117,13 @@ jar.dependsOn createVersionInfoFile
task sourceJar(type: Jar) {
description = "Create a JAR with all sources"
from sourceSets.main.allSource
classifier = 'sources'
archiveClassifier = "sources"
}

task javadocJar(type: Jar, dependsOn: javadoc) {
description = "Create a JAR with the JavaDoc for the java sources"
from javadoc.destinationDir
classifier = 'javadoc'
archiveClassifier = "javadoc"
}

task runInteractiveTest(type: JavaExec, dependsOn: testClasses) {
Expand Down Expand Up @@ -177,5 +171,3 @@ spotbugs {
javadoc {
failOnError = false
}


17 changes: 7 additions & 10 deletions cr-destsol/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
plugins {
id "java-library"
id "maven-publish"
id "eclipse"
id "idea"
}

dependencies {
// Using the parent's path here to allow the CR to be embedded deeper in a Terasology workspace
String crCorePath = parent.path + ":cr-core"
// If we're in a standalone workspace we'll end up with "::cr-core" so fix real quick
crCorePath = crCorePath.replaceAll('::', ':')
println "cr-destsol is setting its cr-core dependency using path " + crCorePath
compile project(crCorePath)
Comment on lines -10 to -15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just no longer necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was trying to do path-manipulation hijinks so it could work like an included build does, before included builds were an official gradle feature.

api project(":cr-core")
}

apply from: "$rootDir/gradle/common.gradle"
17 changes: 7 additions & 10 deletions cr-terasology/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
plugins {
id "java-library"
id "maven-publish"
id "eclipse"
id "idea"
}

repositories {
maven {
Expand All @@ -19,12 +21,7 @@ repositories {
}

dependencies {
// Using the parent's path here to allow the CR to be embedded deeper in a Terasology workspace
String crCorePath = parent.path + ":cr-core"
// If we're in a standalone workspace we'll end up with "::cr-core" so fix real quick
crCorePath = crCorePath.replaceAll('::', ':')
println "cr-terasology is setting its cr-core dependency using path " + crCorePath
compile project(crCorePath)
api project(":cr-core")
}

java {
Expand Down
1 change: 0 additions & 1 deletion gradle/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'

publishing {
Expand Down