-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
119 lines (102 loc) · 3.29 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
// add the build script
buildscript {
dependencies {
classpath 'net.researchgate:gradle-release:2.6.0'
classpath "com.adtran:scala-multiversion-plugin:1.+"
}
}
plugins {
id 'java'
id 'java-gradle-plugin'
}
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'net.researchgate.release'
apply plugin: "com.adtran.scala-multiversion-plugin"
configurations {
scalaCompilerPlugin
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile "org.scala-lang:scala-library:$scalaVersion"
compile "ch.epfl.scala:scalafix-cli_$scalaVersion:0.9.4"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task packageJavadoc(type: Jar) {
from javadoc
classifier = 'javadoc'
}
ext {
v_ossrhUsername = System.getenv('SONATYPE_USER')
ossrhPassword = System.getenv('SONATYPE_TOKEN')
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
artifact packageJavadoc
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name "gradle-scalafix-plugin_${scalaVersion}"
description 'A library to run scalafix'
url 'https://github.com/rpau/gradle-scalafix-plugin'
scm {
url 'https://github.com/rpau/gradle-scalafix-plugin'
connection 'https://github.com/rpau/gradle-scalafix-plugin.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'rpau'
name 'Raquel Pau'
email '[email protected]'
}
}
}
}
repositories {
maven {
credentials {
username "${v_ossrhUsername}"
password "${ossrhPassword}"
}
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
}
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
allprojects {
ext."signing.keyId" = "53E1A142"
ext."signing.secretKeyRingFile" = System.getenv('HOME') + "/.gnupg/secring.gpg"
ext."signing.password" = System.getenv('SIGNATURE_PWD')
}
}
}
signing {
sign publishing.publications.mavenJava
}