1
1
import de.undercouch.gradle.tasks.download.Download
2
2
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
3
3
4
- val deployerJars by configurations.creating
4
+ val tag = System .getenv( " TRAVIS_TAG " )?.replaceFirst( " ^v " .toRegex(), " " )
5
5
6
6
group = " org.utplsql"
7
7
val 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
9
11
10
12
val coverageResourcesVersion = " 1.0.1"
11
13
val ojdbcVersion = " 12.2.0.1"
14
+ val junitVersion = " 5.4.1"
15
+
16
+ val deployerJars by configurations.creating
12
17
13
18
plugins {
14
19
`java- library`
@@ -28,8 +33,8 @@ repositories {
28
33
url = uri(" https://www.oracle.com/content/secure/maven/content" )
29
34
credentials {
30
35
// 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" )
33
38
}
34
39
}
35
40
mavenCentral()
@@ -47,8 +52,10 @@ dependencies {
47
52
implementation(" com.oracle.jdbc:orai18n:$ojdbcVersion " )
48
53
49
54
// Use Jupiter test framework
50
- testImplementation(" org.junit.jupiter:junit-jupiter:5.4.0 " )
55
+ testImplementation(" org.junit.jupiter:junit-jupiter:$junitVersion " )
51
56
testImplementation(" org.hamcrest:hamcrest:2.1" )
57
+
58
+ // deployer for packagecloud
52
59
deployerJars(" io.packagecloud.maven.wagon:maven-packagecloud-wagon:0.0.6" )
53
60
}
54
61
@@ -66,9 +73,10 @@ tasks {
66
73
val intTest = create<Test >(" intTest" ) {
67
74
dependsOn(test)
68
75
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" )
72
80
}
73
81
useJUnitPlatform()
74
82
include(" **/*IT.class" )
0 commit comments