Try to improve release

This commit is contained in:
crschnick 2023-02-01 10:05:26 +00:00
parent 219a1a2c9f
commit 51dda0606f
9 changed files with 12 additions and 13 deletions

View file

@ -11,7 +11,7 @@ apply from: "$rootDir/gradle/gradle_scripts/junit.gradle"
System.setProperty('excludeExtensionLibrary', 'true') System.setProperty('excludeExtensionLibrary', 'true')
apply from: "$rootDir/gradle/gradle_scripts/extension_test.gradle" apply from: "$rootDir/gradle/gradle_scripts/extension_test.gradle"
version = file("$rootDir/dist/version").text version = rootProject.versionString
group = 'io.xpipe' group = 'io.xpipe'
archivesBaseName = 'xpipe-api' archivesBaseName = 'xpipe-api'

View file

@ -9,8 +9,7 @@ repositories {
mavenCentral() mavenCentral()
} }
def appVersion = file('../dist/version').text def appVersion = rootProject.versionString
def apiVersion = project(':api').version
configurations { configurations {
dep dep
@ -136,7 +135,7 @@ run {
systemProperty 'io.xpipe.app.writeLogs', "true" systemProperty 'io.xpipe.app.writeLogs', "true"
systemProperty 'io.xpipe.app.writeSysOut', "true" systemProperty 'io.xpipe.app.writeSysOut', "true"
systemProperty 'io.xpipe.app.developerMode', "true" systemProperty 'io.xpipe.app.developerMode', "true"
systemProperty 'io.xpipe.app.logLevel', "trace" systemProperty 'io.xpipe.app.logLevel', "debug"
systemProperty "io.xpipe.beacon.port", "21724" systemProperty "io.xpipe.beacon.port", "21724"
// systemProperty "io.xpipe.beacon.printMessages", "true" // systemProperty "io.xpipe.beacon.printMessages", "true"
systemProperty "io.xpipe.app.extensions", extensionDirList systemProperty "io.xpipe.app.extensions", extensionDirList
@ -166,8 +165,7 @@ task writeBuildProperties(type: DefaultTask) {
def resourcesDir = new File(sourceSets.main.output.resourcesDir, "io/xpipe/app/resources") def resourcesDir = new File(sourceSets.main.output.resourcesDir, "io/xpipe/app/resources")
resourcesDir.mkdirs() resourcesDir.mkdirs()
def contents = "version=$appVersion\n" + def contents = "version=$appVersion\n" +
"build=$appVersion-${new Date().format('yyyyMMddHHmm')}\n" + "build=$appVersion-${new Date().format('yyyyMMddHHmm')}\n"
"apiVersion=$apiVersion\n"
new File(resourcesDir, "app.properties").text = contents new File(resourcesDir, "app.properties").text = contents
} }
} }

View file

@ -11,7 +11,7 @@ apply from: "$rootDir/gradle/gradle_scripts/lombok.gradle"
dependencies { dependencies {
} }
version = file("$rootDir/dist/version").text version = rootProject.versionString
group = 'io.xpipe' group = 'io.xpipe'
archivesBaseName = 'xpipe-beacon' archivesBaseName = 'xpipe-beacon'

View file

@ -25,4 +25,6 @@ project.ext {
fullVersion = file("$rootDir/private_files.txt").exists() fullVersion = file("$rootDir/private_files.txt").exists()
arch = getArchName() arch = getArchName()
privateExtensions = file("$rootDir/private_extensions.txt").exists() ? file("$rootDir/private_extensions.txt").readLines() : [] privateExtensions = file("$rootDir/private_extensions.txt").exists() ? file("$rootDir/private_extensions.txt").readLines() : []
isFullRelease = System.getenv('RELEASE') != null && Boolean.parseBoolean(System.getenv('RELEASE'))
versionString = file('version').text + (isFullRelease ? '' : '-SNAPSHOT')
} }

View file

@ -20,7 +20,7 @@ dependencies {
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: "2.13.0" implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: "2.13.0"
} }
version = file("$rootDir/dist/version").text version = rootProject.versionString
group = 'io.xpipe' group = 'io.xpipe'
archivesBaseName = 'xpipe-core' archivesBaseName = 'xpipe-core'

2
dist/build.gradle vendored
View file

@ -23,7 +23,7 @@ repositories {
} }
version = file('version').text version = rootProject.versionString
project.ext { project.ext {
buildId = UUID.nameUUIDFromBytes(version.toString().getBytes()) buildId = UUID.nameUUIDFromBytes(version.toString().getBytes())

View file

@ -13,7 +13,7 @@ configurations {
compileOnly.extendsFrom(dep) compileOnly.extendsFrom(dep)
} }
version = file("$rootDir/dist/version").text version = rootProject.versionString
group = 'io.xpipe' group = 'io.xpipe'
archivesBaseName = 'xpipe-extension' archivesBaseName = 'xpipe-extension'

View file

@ -3,13 +3,12 @@ java {
withSourcesJar() withSourcesJar()
} }
def isSnapshot = project.getVersion().endsWith('SNAPSHOT') def repoUrl = !rootProject.isFullRelease ? 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
def repoUrl = isSnapshot ? 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
: 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' : 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def user = project.hasProperty('sonatypeUsername') ? project.property('sonatypeUsername') : System.getenv('SONATYPE_USERNAME') def user = project.hasProperty('sonatypeUsername') ? project.property('sonatypeUsername') : System.getenv('SONATYPE_USERNAME')
def pass = project.hasProperty('sonatypePassword') ? project.property('sonatypePassword') : System.getenv('SONATYPE_PASSWORD') def pass = project.hasProperty('sonatypePassword') ? project.property('sonatypePassword') : System.getenv('SONATYPE_PASSWORD')
if (!isSnapshot) { if (rootProject.isFullRelease) {
publish.finalizedBy(rootProject.getTasks().getByName('closeAndReleaseRepository')) publish.finalizedBy(rootProject.getTasks().getByName('closeAndReleaseRepository'))
} }