-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (101 loc) · 3.14 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
plugins {
id 'java'
id 'idea'
id 'maven'
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation group: 'com.google.guava', name: 'guava', version: '28.2-jre'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.7'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.3'
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.3'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.5.2'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
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
}
jar {
includeEmptyDirs = false
from sourceSets.main.output.classesDirs
from sourceSets.main.output.resourcesDir
manifest {
attributes 'Implementation-Title': 'Battleships Logic',
'Implementation-Version': "${project.version}"
}
}
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.artifact
packaging 'jar'
description 'logic component of battleships'
url 'https://github.com/coding-pirates/logic'
scm {
url 'https://github.com/coding-pirates/logic'
connection 'scm:git:git://github.com/coding-pirates/logic.git'
developerConnection 'scm:git:git@github.com:coding-pirates/logic.git'
}
issueManagement {
system 'github'
url 'https://github.com/coding-pirates/logic/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)
}
}