forked from liquibase/liquibase-groovy-dsl
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
171 lines (151 loc) · 4.95 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath("com.jfrog.bintray.gradle:gradle-bintray-plugin:0.6")
}
}
plugins {
kotlin("jvm") version "1.2.41"
`maven-publish`
}
//apply plugin: 'groovy'
//apply plugin: 'signing'
//apply plugin: 'com.jfrog.bintray'
// Release version that won't conflict with the bintray plugin
group = "org.liquibase"
version = "1.2.2"
configurations {
"archives"()
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile(kotlin("compiler"))
compile(kotlin("script-util"))
compile("org.liquibase:liquibase-core:3.4.2")
testCompile("junit:junit:4.12")
testCompile(kotlin("test"))
testRuntime("com.h2database:h2:1.4.185")
archives("org.apache.maven.wagon:wagon-ssh:2.8")
archives("org.apache.maven.wagon:wagon-ssh-external:2.8")
}
tasks {
"sourceJar"(Jar::class) {
description = "An archive of the source code for Maven Central"
classifier = "sources"
from(java.sourceSets["main"].allSource)
}
getting(Wrapper::class) {
gradleVersion = "4.7"
}
}
/*
artifacts {
archives jar, sourceJar
}
signing {
sign configurations.archives
}
// Only *Require* signing if we are uploading a non snapshot version. If we
// do need to sign, make sure we've got the properties we need to do the
// signing.
gradle.taskGraph.whenReady { taskGraph ->
tasks.withType(Sign).all {
required = taskGraph.hasTask(':uploadArchives') && !isSnapshot
if (required) {
// Use Java's console to read from the console (no good for a CI
// environment)
Console console = System.console()
console.printf '\n\nWe have to sign some things in this build...\n\n'
if (!project.hasProperty('signing.keyId')) {
def id = console.readLine('PGP Public Key Id: ')
allprojects { ext.'signing.keyId' = id }
}
if (!project.hasProperty('signing.secretKeyRingFile')) {
def file = console.readLine('PGP Secret Key Ring File (absolute path): ')
allprojects { ext.'signing.secretKeyRingFile' = file }
}
if (!project.hasProperty('signing.password')) {
def password = console.readPassword('PGP Private Key Password: ')
allprojects { ext.'signing.password' = password }
}
console.printf '\nThanks.\n\n'
}
}
}
uploadArchives {
// We can't use taskGraph.whenReady because it doesn't resolve until after
// configuration. The startParameter is not as good, but it probably
// good enough for our purposes.
if (gradle.startParameter.taskNames.contains('uploadArchives')) {
// Use Java's console to read from the console (no good for a CI
// environment)
Console console = System.console()
console.printf '\n\nWe have to upload some things in this build...\n\n'
if (!project.hasProperty('mavenCentralUsername')) {
def mavenCentralUsername = console.readLine('Maven Central Username: ')
allprojects { ext.'mavenCentralUsername' = mavenCentralUsername }
}
if (!project.hasProperty('mavenCentralPassword')) {
def mavenCentralPassword = console.readLine('Maven Central Password: ')
allprojects { ext.'mavenCentralPassword' = mavenCentralPassword }
}
repositories {
mavenDeployer {
if (signing.signatory) {
beforeDeployment { signing.signPom(it) }
}
configuration = configurations.archives
//repository(url: 'file://$buildDir/m2repo')
repository(url: mavenCentralUploadUrl) {
authentication(userName: mavenCentralUsername,
password: mavenCentralPassword)
releases(updatePolicy: 'always')
snapshots(updatePolicy: 'always')
}
pom.project(pomConfiguration)
}
}
}
}
def getPomConfiguration() {
return {
name('Kotlin Liquibase DSL')
description('A Kotlin-based DSL for the Liquibase database refactoring tool.')
url('https://github.com/redundent/liquibase-kotlin-dsl')
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'redundent'
name 'Jason Blackwell'
email '[email protected]'
}
}
}
}*/
// publishing {
// repositories {
// mavenLocal()
// }
// publications {
// maven(MavenPublication) {
// from components.java
//
// artifact sourceJar {
// classifier 'sources'
// }
// }
// }
// }
//}