mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-07 07:51:46 +01:00
Automatic version incrementing
Build artifact now 5.0-SNAPSHOT
Version is 5.0 build $number where number is amount of commits since
cdb13e3b66
This commit is contained in:
parent
b5d496e9ad
commit
3744b1b98b
@ -22,7 +22,21 @@ allprojects {
|
||||
wrapper.gradleVersion = "5.5.1"
|
||||
|
||||
group "com.djrapitops"
|
||||
version "5.0 build 292"
|
||||
version "5.0-SNAPSHOT"
|
||||
|
||||
def determineBuildVersion = {
|
||||
def buildInfo = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine 'git', 'rev-list', '--count', 'HEAD', '^cdb13e3b663b18e3938ad5efc60d165fa9301f6e'
|
||||
standardOutput = buildInfo
|
||||
}
|
||||
return buildInfo.toString().replaceAll("[^0-9]", "")
|
||||
}
|
||||
|
||||
ext.majorVersion = '5'
|
||||
ext.minorVersion = '0'
|
||||
ext.buildVersion = determineBuildVersion()
|
||||
ext.fullVersion = "$majorVersion.$minorVersion build $buildVersion"
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
|
@ -18,7 +18,22 @@ dependencies {
|
||||
testCompile "com.google.code.gson:gson:$gsonVersion"
|
||||
}
|
||||
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
task updateVersion(type: Copy) {
|
||||
from('src/main/resources') {
|
||||
include 'plugin.yml'
|
||||
include 'bungee.yml'
|
||||
}
|
||||
into 'build/sources/resources/'
|
||||
filter(ReplaceTokens, tokens: [version: '' + project.ext.fullVersion])
|
||||
}
|
||||
processResources {
|
||||
dependsOn updateVersion
|
||||
from 'build/sources/resources'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
dependsOn processResources
|
||||
configurations = [project.configurations.compile]
|
||||
|
||||
// Exclude these files
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: Plan
|
||||
author: Rsl1122
|
||||
main: com.djrapitops.plan.PlanBungee
|
||||
version: 5.0 build 292
|
||||
version: @version@
|
||||
softdepend:
|
||||
- AdvancedBan
|
||||
- LiteBans
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: Plan
|
||||
author: Rsl1122
|
||||
main: com.djrapitops.plan.Plan
|
||||
version: 5.0 build 292
|
||||
version: @version@
|
||||
api-version: 1.13
|
||||
softdepend:
|
||||
- ASkyBlock
|
||||
|
@ -23,12 +23,16 @@ shadowJar {
|
||||
classifier = null
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn tasks.named("shadowJar")
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
groupId = 'com.djrapitops'
|
||||
artifactId = 'Plan-plugin'
|
||||
version = project.version
|
||||
version = "$fullVersion"
|
||||
|
||||
artifact shadowJar
|
||||
}
|
||||
|
@ -1,3 +1,12 @@
|
||||
plugins {
|
||||
id "net.kyori.blossom" version "1.1.0"
|
||||
}
|
||||
|
||||
blossom {
|
||||
replaceTokenIn('src/main/java/com/djrapitops/plan/PlanSponge.java')
|
||||
replaceToken('@version@', "$fullVersion")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(path: ":common", configuration: 'shadow')
|
||||
compileOnly project(":api")
|
||||
|
@ -42,7 +42,7 @@ import java.io.InputStream;
|
||||
@Plugin(
|
||||
id = "plan",
|
||||
name = "Plan",
|
||||
version = "5.0 build 292",
|
||||
version = "@version@",
|
||||
description = "Player Analytics Plugin by Rsl1122",
|
||||
authors = {"Rsl1122"},
|
||||
dependencies = {
|
||||
|
@ -1,3 +1,12 @@
|
||||
plugins {
|
||||
id "net.kyori.blossom" version "1.1.0"
|
||||
}
|
||||
|
||||
blossom {
|
||||
replaceTokenIn('src/main/java/com/djrapitops/plan/PlanVelocity.java')
|
||||
replaceToken('@version@', "$fullVersion")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(path: ":common", configuration: 'shadow')
|
||||
compileOnly project(":api")
|
||||
@ -13,5 +22,7 @@ dependencies {
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
dependsOn blossomSourceReplacementJava
|
||||
|
||||
configurations = [project.configurations.compile]
|
||||
}
|
@ -45,7 +45,7 @@ import java.nio.file.Path;
|
||||
@Plugin(
|
||||
id = "plan",
|
||||
name = "Plan",
|
||||
version = "5.0 build 292",
|
||||
version = "@version@",
|
||||
description = "Player Analytics Plugin by Rsl1122",
|
||||
authors = {"Rsl1122"}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user