Skip to content

Commit

Permalink
Upgraded Gradle to version 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rbluer committed Jul 17, 2021
1 parent 6079195 commit fe184ca
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
33 changes: 29 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,39 @@ import java.text.SimpleDateFormat
import java.util.Date

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
//apply plugin: 'maven'
//apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'

archivesBaseName = 'MiniGamePlayerQueue'
group = 'com.royalblueranger.mgpq'

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"

ext.targetArchiveClassifier = 'Java1.8'

sourceCompatibility = 1.8
targetCompatibility = 1.8


// Lists all versions of java that are available to the toolchain
// $ ./gradlew -q javaToolchains

// Specify the java version's location as found in the javaToolchains.
// $ ./gradlew build -Dorg.gradle.java.home="C:\Program Files\Java\jdk1.8.0_291"

//java {
// toolchain {
// languageVersion.set(JavaLanguageVersion.of(8))
//// languageVersion.set(JavaLanguageVersion.of(16))
// }
//}

repositories {
mavenCentral()

maven { url "http://maven.sk89q.com/repo/" }
maven { url "https://maven.sk89q.com/repo/" }
// maven { url "https://mvnrepository.com/artifact/org.apache.commons/commons-lang3" }

maven { url = "https://hub.spigotmc.org/nexus/content/groups/public" }
Expand Down Expand Up @@ -85,7 +104,7 @@ dependencies {

compileOnly 'net.milkbowl.vault:VaultAPI:1.6'

testCompile 'junit:junit:4.12'
testImplementation 'junit:junit:4.12'

// compileOnly 'com.github.PrisonTeam:Prison:bleeding-SNAPSHOT'
// implementation 'com.github.PrisonTeam:Prison:3.2.6'
Expand Down Expand Up @@ -156,6 +175,12 @@ processResources {
from(sourceSets.main.resources.srcDirs) {
exclude 'plugin.yml', 'config.yml'
}


// Need to have includ duplicates for the version to be updated in the plugin.yml file.
// Also the final build is actually smaller with include.
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE // do not allow duplicates
}

shadowJar {
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## # This is actually the "correct" place to define the version for the project.
## # Used within build.gradle with ${project.version}.
## # Can be overridden on the command line: gradle -Pversion=3.2.1-alpha.3
version=0.1.1
version=0.1.2

## org.gradle.warning.mode=(all,none,summary)
org.gradle.warning.mode=all
Expand All @@ -26,3 +26,7 @@ javadoc.options.encoding = 'UTF-8'
xlint:deprecation


systemProp.org.gradle.internal.http.connectionTimeout=180000
systemProp.org.gradle.internal.http.socketTimeout=180000


2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 13 additions & 0 deletions gradle_readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Gradle Read Me

2021-07-17 - Updating gradle to v7.x
- Had installed java 16 so cannot run the current gradle version which is v5.6.4
- Must use -Dorg.gradle.java.home="C:\Program Files\Java\jdk1.8.0_291" to force gradle to use java 1.8

To upgrade gradle:

./gradlew wrapper --gradle-version 6.0 -Dorg.gradle.java.home="C:\Program Files\Java\jdk1.8.0_291"
./gradlew --version -Dorg.gradle.java.home="C:\Program Files\Java\jdk1.8.0_291" :: Will actually install the new version
gradlew build (as normal):: Will build project with the new version to ensure all is good. If build is good, then you can try to upgrade to the next version.


4 changes: 2 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down

0 comments on commit fe184ca

Please sign in to comment.