-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
150 lines (124 loc) · 4.18 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
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
apply plugin: 'groovy'
apply plugin: 'com.github.johnrengelman.shadow'
version='0.3.1'
archivesBaseName = "mrgadget"
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
}
}
dependencies {
compile 'com.jcraft:jsch:0.1.53' // JSch is the SSH java package
compile 'org.jasypt:jasypt-acegisecurity:1.9.2' // for encrypting the stored passwords
compile 'org.slf4j:slf4j-api:1.7.13'
runtime 'org.slf4j:slf4j-simple:1.7.13'
compile 'org.codehaus.groovy:groovy:2.4.5'
testCompile 'junit:junit:4.12'
//testCompile 'org.apache.sshd:sshd-core:0.7.0', 'org.apache.sshd:sshd:0.7.0', 'org.apache.sshd:apache-sshd:0.7.0', 'org.apache.sshd:sshd-pam:0.7.0', 'org.apache.mina:mina-core:2.0.5'
testRuntime 'bouncycastle:bcprov-jdk15:140'
testCompile 'org.apache.mina:mina-core:2.0.4', 'org.apache.sshd:sshd-core:0.7.0'
//testCompile 'directory:apacheds-main:0.9.3'
}
repositories {
mavenCentral()
}
task writeVersionInfo << {
File file = file 'src/main/resources/version'
file.write("${version}")
}
build.dependsOn writeVersionInfo
jar {
baseName = "mrgadget"
manifest {
attributes("Implementation-Title": "MrGadget", "Implementation-Version": version)
}
}
shadowJar {
baseName = "mrgadget"
classifier 'jar-with-dependencies'
manifest {
attributes("Implementation-Title": "MrGadget", "Implementation-Version": version)
}
dependencies {
exclude(dependency('org.codehaus.groovy:groovy:.*'))
exclude(dependency('org.slf4j:slf4j-simple:.*'))
}
}
task jarsToRepo << {
copy {
println "Copying ${jar.archiveName} to $projectDir/repo/com_moksamedia/mrgadget/$version"
from("$buildDir/libs/${jar.archiveName}")
into("$projectDir/repo/com_moksamedia/mrgadget/$version")
}
copy {
println "Copying ${shadowJar.archiveName} to $projectDir/repo/com_moksamedia/mrgadget/$version"
from("$buildDir/libs/${shadowJar.archiveName}")
into("$projectDir/repo/com_moksamedia/mrgadget/$version")
}
}
jarsToRepo.dependsOn shadowJar, jar
/*
* REQUIRED FOR OSS SONATYPE AND MAVEN CENTRAL DEPLOYMENT
*/
/*
apply plugin: 'maven'
apply plugin: 'signing'
group = 'com.moksamedia'
// create sources jar and javadoc jar (required for deployment to maven central)
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// add the jars as artifacts
artifacts {
archives sourcesJar
archives javadocJar
archives jar
archives shadowJar
}
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name 'MrGadget'
packaging 'jar'
description 'MrGadget is a utility (build for Gradle, but generally usable anywhere) that can upload files to a remote server and execute commands on a remote server'
url 'http://github.com/moksamedia/MrGadget'
scm {
url 'scm:[email protected]:moksamedia/MrGadget.git'
connection 'scm:[email protected]:moksamedia/MrGadget.git'
developerConnection 'scm:[email protected]:moksamedia/MrGadget.git'
}
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 'cantgetnosleep'
name 'Andrew Hughes'
}
}
}
}
}
}
*/