-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
115 lines (100 loc) · 3.06 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
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'idea'
version = '1.1-1.3.3-SNAPSHOT'
group = 'de.obqo.gradle'
ext.archivesBaseName = 'gradle-lesscss-plugin'
ext.isSnapshot = version.endsWith("-SNAPSHOT")
def authUsername = hasProperty('sonatypeUsername') ? sonatypeUsername : ''
def authPassword = hasProperty('sonatypePassword') ? sonatypePassword : ''
repositories {
mavenCentral()
}
dependencies {
groovy localGroovy()
compile gradleApi()
testCompile ('org.spockframework:spock-core:0.6-groovy-1.8') {
exclude module: "junit-dep"
exclude module: "groovy-all"
}
}
idea.module {
ext.gradleCacheVariable = 'GRADLE_CACHE'
downloadJavadoc = true
ext.downloadSource = true
outputDir = file("intellij/out")
testOutputDir = file("intellij/testOut")
}
task sourceJar(type: Jar) {
description = 'An archive of the source code for Maven Central'
classifier = 'sources'
from sourceSets.main.groovy
}
task groovydocJar(type: Jar) {
description = 'An archive of the GroovyDocs for Maven Central'
classifier = 'javadoc'
from groovydoc
}
artifacts {
archives groovydocJar, sourceJar
}
signing {
sign configurations.archives
}
// Only *require* signing if we are uploading a non snapshot version
gradle.taskGraph.whenReady { taskGraph ->
tasks.withType(org.gradle.plugins.signing.Sign).all {
required = taskGraph.hasTask(":uploadArchives") && !isSnapshot
}
}
install.repositories.mavenInstaller {
pom.project(pomConfiguration)
if (signing.signatory) {
beforeDeployment { signing.signPom(it) }
}
}
uploadArchives {
repositories.mavenDeployer {
if (signing.signatory) {
beforeDeployment { signing.signPom(it) }
}
name = 'mavenCentralReleaseDeployer'
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: authUsername, password: authPassword)
releases(updatePolicy: 'always')
snapshots(updatePolicy: 'always')
}
pom.project(pomConfiguration)
}
}
/**
* Create POM config and return for use by other tasks.
*/
def getPomConfiguration() {
return {
name 'Gradle LessCss Plugin'
packaging 'jar'
description 'A Gradle plugin for compiling LESS files to CSS files.'
url 'https://github.com/obecker/gradle-lesscss-plugin'
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 'obecker'
name 'Oliver Becker'
email '[email protected]'
}
}
scm {
connection 'scm:git://github.com/obecker/gradle-lesscss-plugin.git'
developerConnection 'scm:[email protected]:obecker/gradle-lesscss-plugin.git'
url 'https://github.com/obecker/gradle-lesscss-plugin'
}
}
}