11import de.undercouch.gradle.tasks.download.Download
22import org.gradle.api.tasks.testing.logging.TestExceptionFormat
33
4- val deployerJars by configurations.creating
4+ val tag = System .getenv( " TRAVIS_TAG " )?.replaceFirst( " ^v " .toRegex(), " " )
55
66group = " org.utplsql"
77val mavenArtifactId = " java-api"
8- version = " 3.1.7-SNAPSHOT"
8+ val baseVersion = " 3.1.7-SNAPSHOT"
9+ // if build is on tag like 3.1.7 or v3.1.7 then use tag as version replacing leading "v"
10+ version = if (tag != null && " ^[0-9.]+$" .toRegex().matches(tag)) tag else baseVersion
911
1012val coverageResourcesVersion = " 1.0.1"
1113val ojdbcVersion = " 12.2.0.1"
14+ val junitVersion = " 5.4.1"
15+
16+ val deployerJars by configurations.creating
1217
1318plugins {
1419 `java- library`
@@ -28,8 +33,8 @@ repositories {
2833 url = uri(" https://www.oracle.com/content/secure/maven/content" )
2934 credentials {
3035 // you may set this properties using gradle.properties file in the root of the project or in your GRADLE_HOME
31- username = if (project.hasProperty (" ORACLE_OTN_USER" )) project.property( " ORACLE_OTN_USER " ) as String? else System .getenv(" ORACLE_OTN_USER" )
32- password = if (project.hasProperty (" ORACLE_OTN_PASSWORD" )) project.property( " ORACLE_OTN_PASSWORD " ) as String? else System .getenv(" ORACLE_OTN_PASSWORD" )
36+ username = (project.findProperty (" ORACLE_OTN_USER" ) as String? ) ? : System .getenv(" ORACLE_OTN_USER" )
37+ password = (project.findProperty (" ORACLE_OTN_PASSWORD" ) as String? ) ? : System .getenv(" ORACLE_OTN_PASSWORD" )
3338 }
3439 }
3540 mavenCentral()
@@ -47,8 +52,10 @@ dependencies {
4752 implementation(" com.oracle.jdbc:orai18n:$ojdbcVersion " )
4853
4954 // Use Jupiter test framework
50- testImplementation(" org.junit.jupiter:junit-jupiter:5.4.0 " )
55+ testImplementation(" org.junit.jupiter:junit-jupiter:$junitVersion " )
5156 testImplementation(" org.hamcrest:hamcrest:2.1" )
57+
58+ // deployer for packagecloud
5259 deployerJars(" io.packagecloud.maven.wagon:maven-packagecloud-wagon:0.0.6" )
5360}
5461
@@ -66,9 +73,10 @@ tasks {
6673 val intTest = create<Test >(" intTest" ) {
6774 dependsOn(test)
6875 doFirst {
69- environment(" DB_URL" , System .getenv(" DB_URL" ) ? : " localhost:1521/XE" )
70- environment(" DB_USER" , System .getenv(" DB_USER" ) ? : " app" )
71- environment(" DB_PASS" , System .getenv(" DB_PASS" ) ? : " app" )
76+ environment(" DB_URL" , (project.findProperty(" DB_URL" ) as String? ) ? : System .getenv(" DB_URL" )
77+ ? : " localhost:1521/XE" )
78+ environment(" DB_USER" , (project.findProperty(" DB_USER" ) as String? ) ? : System .getenv(" DB_USER" ) ? : " app" )
79+ environment(" DB_PASS" , (project.findProperty(" DB_PASS" ) as String? ) ? : System .getenv(" DB_PASS" ) ? : " app" )
7280 }
7381 useJUnitPlatform()
7482 include(" **/*IT.class" )
0 commit comments