-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
144 lines (127 loc) · 3.28 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
/*buildscript {
repositories {
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.0'
}
}*/
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
//apply plugin: 'com.github.johnrengelman.shadow'
configurations {
deployerJars
}
repositories {
mavenCentral()
maven {
name = 'FTB'
url = 'https://ftb.cursecdn.com/FTB2/maven'
}
maven {
name = 'thiakil'
url = 'http://maven.thiakil.com/'
}
}
dependencies {
compile 'com.thiakil:CurseApi:1.0.13'//curse integration
compile 'com.google.code.gson:gson:2.8.2'//JSON support
compile 'commons-io:commons-io:2.6'//general utility classes
compile 'com.google.guava:guava:24.0-jre'//general utility classes
compile 'org.projectlombok:lombok:1.16.20'//getter/setter equals and hashcode automation
compile 'org.javers:javers-core:3.8.5'//diff support
deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2'
}
project.ext {
currentYear = '2018'
}
if (System.getenv().BUILD_NUMBER != null) {
ext.buildNum = System.getenv().BUILD_NUMBER
} else {
ext.buildNum = "9999999"
}
group = 'net.ftb.packchangeloglib'
version = "0.0.1-${project.buildNum}"
description = "FTB Pack Changelog Library"
sourceCompatibility = 1.8
targetCompatibility = 1.8
/*shadowJar {
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
classifier = 'all'
}*/
//build.dependsOn(shadowJar)
jar {
manifest {
attributes 'Launcher-Jenkins': project.buildNum
}
}
task sourceJar(type: Jar) {
from sourceSets.main.java
from sourceSets.main.resources
classifier = "sources"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier = "javadoc"
}
artifacts {
// archives shadowJar
archives jar
archives sourceJar
archives javadocJar
}
def gitSha() {
return 'git rev-parse HEAD'.execute().text.trim()
}
publishing {
publications {
mavenJava(MavenPublication) {
//artifact shadowJar
artifact jar
artifact sourceJar
artifact javadocJar
}
}
repositories {
maven {
if (project.hasProperty("s3_url")) {
url "s3://${s3_url}"
credentials(AwsCredentials) {
accessKey "${s3_key}"
secretKey "${s3_secret}"
}
}
}
}
}
if (project.hasProperty("local_maven")) {
apply plugin: 'maven'
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://${local_maven}")
}
}
}
}
if (project.hasProperty("remote_maven") && project.hasProperty("sftp_pass")) {
apply plugin: 'maven'
uploadArchives {
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: "sftp://${remote_maven}") {
authentication(userName: "${ftp_username}", password: "${sftp_pass}")
}
}
}
}