-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
142 lines (118 loc) · 3.97 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
plugins {
id 'java'
id 'idea'
id 'maven'
}
repositories{
mavenCentral()
mavenLocal()
maven {
url = "https://maven.paube.de"
}
}
dependencies {
compile group: 'de.upb.codingpirates.battleships', name: 'ai', version: project.ai_version
compile group: 'de.upb.codingpirates.battleships', name: 'network', version: project.network_version
compile group: 'de.upb.codingpirates.battleships', name: 'logic', version: project.logic_version
compile group: 'de.upb.codingpirates.battleships', name: 'client', version: project.client_version
compile group: 'com.google.inject', name: 'guice', version: '4.2.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.0'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.0'
implementation group: 'com.google.guava', name: 'guava', version: '28.2-jre'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.7'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.5.2'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
task sourceJar(type: Jar, dependsOn: classes){
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourceJar
archives javadocJar
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
jar {
includeEmptyDirs = false
from sourceSets.main.output.classesDirs
from sourceSets.main.output.resourcesDir
manifest {
attributes 'Implementation-Title': 'Battleships Server',
'Implementation-Version': "${project.version}"
}
}
task fatJar(type: Jar) {
manifest.from jar.manifest
archiveClassifier.set 'all'
from ( configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } ) {
exclude 'META-INF/**/*'
exclude 'log4j2.xml'
}
with jar
}
configurations {
deployerJars
}
dependencies {
deployerJars "org.apache.maven.wagon:wagon-ftp:2.9"
}
uploadArchives {
repositories {
add getProject().repositories.mavenLocal()
}
repositories.mavenDeployer {
configuration = configurations.deployerJars
logger.info('Publishing to files server')
if (project.hasProperty("maven_url")) {
repository(url: project.getProperty("maven_url")) {
authentication(userName: project.getProperty("maven_user"), password: project.getProperty("maven_password"))
}
} else {
repository(url: 'file://localhost/' + project.file('../../.m2/repository').getAbsolutePath())
}
pom {
groupId = project.group
version = project.version
artifactId = project.artifact
}
pom.project {
name project.archivesBaseName
packaging 'jar'
description 'server component of battleships'
url 'https://github.com/Cheaterpaul/Battleships-Server'
scm {
url 'https://github.com/Cheaterpaul/Battleships-Server'
connection 'scm:git:git://github.com/Cheaterpaul/Battleships-Server.git'
developerConnection 'scm:git:git@github.com:Cheaterpaul/Battleships-Server.git'
}
issueManagement {
system 'github'
url 'https://github.com/Cheaterpaul/Battleships-Server/issues'
}
developers {
developer {
id 'cheaterpaul'
name 'cheaterpaul'
roles { role 'developer' }
}
}
}
}
}
idea.module {
for (String excludeDirName in ["run", "build", "out", "logs", ".gradle", ".github"]) {
excludeDirs += new File(project.projectDir, excludeDirName)
}
}