diff --git a/build.gradle b/build.gradle index f7667a1..e4ed5ad 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,13 @@ ext { branch = System.getenv( 'BRANCH' ) ?: 'development' } +if ( branch == 'development' ) { + // If the branch is 'development', ensure the version ends with '-snapshot' + // This replaces any existing prerelease identifier with '-snapshot' + version = version.contains('-') ? version.replaceAll(/-.*/, '-snapshot') : "${version}-snapshot" + boxlangVersion = boxlangVersion.contains('-') ? boxlangVersion.replaceAll(/-.*/, '-snapshot') : "${boxlangVersion}-snapshot" +} + repositories { mavenLocal() mavenCentral() @@ -32,12 +39,14 @@ dependencies { // Until BoxLang is published to Maven Central // Look for it in the local build directory // You must run `./gradle build -x test` in the BoxLang project - compileOnly files( 'src/test/resources/libs/boxlang-1.0.0-all.jar' ) + compileOnly files( '../../boxlang/build/libs/boxlang-' + boxlangVersion + '-all.jar' ) + compileOnly files( 'src/test/resources/libs/boxlang-' + boxlangVersion + '-all.jar' ) // https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client implementation 'org.mariadb.jdbc:mariadb-java-client:3.3.3' // Testing Dependencies - testImplementation files( 'src/test/resources/libs/boxlang-1.0.0-all.jar' ) + testImplementation files( '../../boxlang/build/libs/boxlang-' + boxlangVersion + '-all.jar' ) + testImplementation files( 'src/test/resources/libs/boxlang-' + boxlangVersion + '-all.jar' ) testImplementation "org.junit.jupiter:junit-jupiter:5.+" testImplementation "org.mockito:mockito-core:5.+" testImplementation "com.google.truth:truth:1.+" @@ -134,7 +143,7 @@ task createModuleStructure(type: Copy) { // Token Replacements Go Here filter{ line -> line.replaceAll( '@build.version@', project.version ) } if( project.branch == "development" ){ - filter{ line -> line.replaceAll( '\\+@build.number@', '-SNAPSHOT' ) } + filter{ line -> line.replaceAll( '\\+@build.number@', '' ) } } else { filter{ line -> line.replaceAll( '@build.number@', project.buildID ) } } @@ -146,7 +155,7 @@ task createModuleStructure(type: Copy) { // Token Replacements Go Here filter{ line -> line.replaceAll( '@build.version@', project.version ) } if( project.branch == "development" ){ - filter{ line -> line.replaceAll( '\\+@build.number@', '-SNAPSHOT' ) } + filter{ line -> line.replaceAll( '\\+@build.number@', '' ) } } else { filter{ line -> line.replaceAll( '@build.number@', project.buildID ) } }