Skip to content

Commit

Permalink
build: add -dev suffix to api version in development build
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Jan 5, 2025
1 parent 4704282 commit 2ce975f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Unless otherwise specified, any version comparison below is the comparison of se
- (API) `EntityBaseComponent#getBlockStateStandingOn` now return `BlockStateWithPos` instead of `BlockState`.
- (API) Removed `BlockFace#horizontalIndex` which is useless.
- Removed useless class `PackageClassLoaderUtils`, dependency `org.reflections.reflections` is also removed.
- Added `-dev` suffix to api version in development build.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* The current version of allay-api
*/
version = "0.4.0"
version = "0.4.0" + if (rootProject.ext.get("isDevBuild") as Boolean) "-dev" else ""

dependencies {
api(libs.network) {
Expand Down
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ plugins {
id("maven-publish")
}

ext {
/**
* Indicates whether the current build is a development build.
*
* This value should be changed to false before release the next stable version,
* and after releasing, change it back to true.
*/
set("isDevBuild", true)
}

tasks.jar {
enabled = false
}
Expand Down
11 changes: 2 additions & 9 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
import java.io.ByteArrayOutputStream

/**
* Indicates whether the current build is a development build.
*
* This value should be changed to false before release the next stable version,
* and after releasing, change it back to true.
*/
val isDevBuild = true
/**
* The current version of allay-server
*
* This is not the same as the version of allay-api.
* Please note that they are two things.
*/
version = "0.1.3" + if (isDevBuild) "-dev" else ""
version = "0.1.3" + if (rootProject.ext.get("isDevBuild") as Boolean) "-dev" else ""

plugins {
id("jacoco")
Expand Down Expand Up @@ -52,7 +45,7 @@ gitProperties {
gitPropertiesName = "git.properties"
gitPropertiesResourceDir.set(file("${rootProject.projectDir}/data/resources"))
gitProperties {
customProperty("git.build.is_dev_build", isDevBuild)
customProperty("git.build.is_dev_build", rootProject.ext.get("isDevBuild") as Boolean)
/**
* The version of allay-api.
*
Expand Down

0 comments on commit 2ce975f

Please sign in to comment.