From c7870b617c8cc838e48d3924667bab56a6783ca1 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 26 Feb 2016 23:55:21 +1100 Subject: [PATCH] Gradle / maven Fix archive names (includes project/module name + version) Generate MD5 hash alongside jar Improve build time - asynchronous building - enable daemon - change scope of a few statements - skip building of 3 jars Add filtering to the plugin.yml (maven/gradle) Bump version to 3.3.0 in pom --- Bukkit/build.gradle | 26 ++++++++++++++++++++++---- Bukkit/src/main/resources/plugin.yml | 4 ++-- Core/build.gradle | 5 +++-- Sponge/build.gradle | 13 +++++++++---- build.gradle | 13 ++++++++----- gradle.properties | 3 +++ pom.xml | 2 +- settings.gradle | 3 +-- 8 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 gradle.properties diff --git a/Bukkit/build.gradle b/Bukkit/build.gradle index b70d0e3e3..156341ac3 100644 --- a/Bukkit/build.gradle +++ b/Bukkit/build.gradle @@ -1,16 +1,34 @@ -apply plugin: 'eclipse' -apply plugin: 'idea' - dependencies { compile project(':Core') compile 'org.bukkit:bukkit:1.8.8-R0.1-SNAPSHOT' compile 'net.milkbowl.vault:VaultAPI:1.5' } +sourceCompatibility = 1.7 +targetCompatibility = 1.7 + +processResources { + from('src/main/resources') { + include 'plugin.yml' + expand( + name: project.parent.name, + version: project.parent.version + ) + } +} + +apply plugin: 'com.github.johnrengelman.shadow' + shadowJar { dependencies { include(dependency(':Core')) } + archiveName = "${parent.name}-${project.name}-${parent.version}.jar" } -build.dependsOn(shadowJar) \ No newline at end of file +shadowJar.doLast { + task -> + ant.checksum file: task.archivePath +} + +build.dependsOn(shadowJar); \ No newline at end of file diff --git a/Bukkit/src/main/resources/plugin.yml b/Bukkit/src/main/resources/plugin.yml index c255240a8..70960981c 100644 --- a/Bukkit/src/main/resources/plugin.yml +++ b/Bukkit/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ -name: PlotSquared +name: ${name} main: com.plotsquared.bukkit.BukkitMain -version: 3.3.0 +version: ${version} load: STARTUP description: > Easy, yet powerful Plot World generation and management. diff --git a/Core/build.gradle b/Core/build.gradle index f2770800b..ba09a052d 100644 --- a/Core/build.gradle +++ b/Core/build.gradle @@ -1,2 +1,3 @@ -apply plugin: 'eclipse' -apply plugin: 'idea' \ No newline at end of file +dependencies { + compile 'org.yaml:snakeyaml:1.16' +} \ No newline at end of file diff --git a/Sponge/build.gradle b/Sponge/build.gradle index 7518bdbe9..74c25ab6e 100644 --- a/Sponge/build.gradle +++ b/Sponge/build.gradle @@ -1,6 +1,3 @@ -apply plugin: 'eclipse' -apply plugin: 'idea' - buildscript { repositories { jcenter() @@ -13,7 +10,9 @@ buildscript { classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' } } + apply plugin: 'net.minecraftforge.gradle.forge' +apply plugin: 'com.github.johnrengelman.shadow' dependencies { compile project(':Core') @@ -33,7 +32,6 @@ repositories { url = "https://repo.spongepowered.org/maven" } } - minecraft { version = "1.8.9-11.15.1.1742" mappings = "snapshot_20160204" @@ -48,10 +46,17 @@ processResources { 'mcVersion': project.minecraft.version } } + shadowJar { dependencies { include(dependency(':Core')) } + archiveName = "${parent.name}-${project.name}-${parent.version}.jar" +} + +shadowJar.doLast { + task -> + ant.checksum file: task.archivePath } reobf { diff --git a/build.gradle b/build.gradle index f6ca60352..a72cddf94 100644 --- a/build.gradle +++ b/build.gradle @@ -8,21 +8,25 @@ buildscript { classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' } } + group = 'com.intellectualcrafters' version = '3.3.0' - description = """PlotSquared""" subprojects { apply plugin: 'java' apply plugin: 'maven' - apply plugin: 'com.github.johnrengelman.shadow' + apply plugin: 'eclipse' + apply plugin: 'idea' + + jar.enabled = false; + dependencies { compile(group: 'com.sk89q', name: 'worldedit', version:'6.0.0-SNAPSHOT') { exclude(module: 'bukkit-classloader-check') } - compile 'org.yaml:snakeyaml:1.16' } + repositories { mavenCentral() maven {url "http://empcraft.com/maven2"} @@ -31,5 +35,4 @@ subprojects { maven {url "http://nexus.theyeticave.net/content/repositories/pub_releases"} maven {url "http://repo.maven.apache.org/maven2"} } - -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..f30cf6d13 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.daemon=true +org.gradle.configureondemand=true +org.gradle.parallel=true \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3a85079d4..56946c731 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 3.2.26 + 3.3.0 PlotSquared jar diff --git a/settings.gradle b/settings.gradle index 78debc8c5..cc0693084 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,3 @@ rootProject.name = 'PlotSquared' -include 'Core', 'Bukkit', 'Sponge' - +include 'Core', 'Bukkit', 'Sponge' \ No newline at end of file