-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
84 lines (72 loc) · 2.2 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
apply plugin:'groovy'
apply plugin:'maven'
apply plugin:'code-quality'
version = '0.8.2'
configurations {
deployerJars
}
configure(install.repositories.mavenInstaller) {
pom.project {
groupId 'com.smokejumperit'
artifactId 'gradle-plugins'
version project.version
}
}
ant.property(environment:'env')
if(!ant.properties['env.GRADLE_HOME']) throw new Exception('Please set $GRADLE_HOME')
repositories {
mavenCentral()
maven { url 'http://repo.smokejumperit.com' }
}
dependencies {
groovy 'org.codehaus.groovy:groovy:1.8.0'
deployerJars "org.apache.maven.wagon:wagon-ssh:1.0-beta-6"
compile fileTree(
dir:System.getenv().get('GRADLE_HOME'),
includes:['**/*.jar']
)
}
processResources {
includes = excludes = []
include "**/*"
exclude "**/.gitignore"
}
jar {
includes = excludes = []
include "**/*"
exclude "**/.gitignore"
}
uploadArchives {
repositories.mavenDeployer {
def repoUser = System.properties['sjit.repo.user'] ?: "[NO USER: SET sjit.repo.user]"
configuration = configurations.deployerJars
repository(url: "scp://repo.smokejumperit.com/home/$repoUser/repo.smokejumperit.com/") {
authentication(
userName: repoUser,
privateKey: new File(System.properties['sjit.repo.keyFile'] ?: "[NO KEYFILE: set sjit.repo.keyFile]").absolutePath,
passphrase: System.properties['sjit.repo.passphrase'] ?: ""
)
pom {
groupId='com.smokejumperit'
artifactId='gradle-plugins'
version= project.version
}
}
}
}
//tasks.uploadArchives.dependsOn(tasks.codenarcMain)
task notePlugins << {
def names = []
sourceSets.main.allGroovy.matching {
include('**/com/smokejumperit/gradle/*Plugin.groovy')
exclude('**/SjitPlugin.groovy')
}.visit {
names << it.file.name.replaceFirst(/\.groovy$/, '')
}
def resourceDir = (sourceSets.main.resources.srcDirs as List)[0]
if(!resourceDir) throw new Exception("No resource directory found!")
['com', 'smokejumperit', 'gradle'].each { resourceDir = new File(resourceDir, it) }
resourceDir.mkdirs() // Does nothing if already exists: see API
new File(resourceDir, 'sjit.plugins').text = names.join("\n")
}
processResources.dependsOn(notePlugins)