-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
119 lines (106 loc) · 4 KB
/
build.gradle
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
plugins {
id 'maven'
id 'signing'
id 'scala'
id 'idea'
id "com.github.maiflai.scalatest" version "0.19"
id "com.adtran.scala-multiversion-plugin" version "1.0.35"
}
group 'me.manishkatoch'
sourceCompatibility = 1.8
ext {
mavenUrl = project.properties.getOrDefault('maven2_url', System.getenv("MVN_URL"))
snapshot_url = project.properties.getOrDefault('snapshot_url', System.getenv("MVN_SNAPSHOT_URL"))
mavenRepositoryUsername = project.properties.getOrDefault('mavenRepositoryUsername', System.getenv("MVN_USERNAME"))
mavenRepositoryPassword = project.properties.getOrDefault('mavenRepositoryPassword', System.getenv("MVN_PASSWORD"))
build_version = project.properties.getOrDefault('buildVersion', System.getenv("BUILD_VERSION"))
}
version build_version
repositories {
mavenCentral()
}
def isRunningOnTravis = System.getenv("CI") == "true"
dependencies {
implementation group: 'org.scala-lang', name: 'scala-library', version: '%scala-version%'
implementation group: 'org.scala-lang', name: 'scala-compiler', version: '%scala-version%'
implementation group: 'org.scala-lang', name: 'scala-reflect', version: '%scala-version%'
implementation group: 'com.chuusai', name: 'shapeless_%%', version: '2.3.3'
testImplementation group: 'org.scalatest', name: 'scalatest_%%', version: '3.0.1'
testRuntime 'org.pegdown:pegdown:1.4.2'
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
allprojects { ext."signing.keyId" = System.getenv('GPG_KEY_ID') }
allprojects {
if (isRunningOnTravis) {
ext."signing.secretKeyRingFile" = file("./secure.gpg")
} else {
ext."signing.secretKeyRingFile" = "./secure.gpg"
}
}
allprojects {
ext."signing.password" = System.getenv('GPG_PASSPHRASE')
}
}
if (taskGraph.allTasks.any { it.name == 'build' || it.name == 'assemble' }) {
tasks.findAll {
it.name == 'signArchives' || it.name == 'signDocsJar' || it.name == 'signTestJar'
}.each { task ->
task.enabled = false
}
}
}
signing {
sign configurations.archives
}
task scaladocJar(type: Jar, dependsOn: scaladoc) {
classifier = 'javadoc'
from "${project.buildDir}/docs/scaladoc"
}
task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives scaladocJar
archives sourceJar
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: mavenUrl) {
authentication(userName: mavenRepositoryUsername, password: mavenRepositoryPassword)
}
snapshotRepository(url: snapshot_url) {
authentication(userName: mavenRepositoryUsername, password: mavenRepositoryPassword)
}
pom.project {
name 'Scala Cypher DSL'
packaging 'jar'
description 'A type safe DSL for writing Cypher Query Language in Scala.'
url 'https://github.com/manishkkatoch/scala-cypher-dsl'
scm {
connection 'scm:git:https://github.com/manishkkatoch/scala-cypher-dsl.git'
developerConnection 'scm:git:https://github.com/manishkkatoch/scala-cypher-dsl.git'
url 'https://github.com/manishkkatoch/scala-cypher-dsl'
}
licenses {
license {
name 'MIT License'
url 'https://github.com/manishkkatoch/scala-cypher-dsl/blob/master/LICENSE'
}
}
developers {
developer {
id 'manishkatoch'
name 'Manish Katoch'
}
}
}
}
}
}