-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
125 lines (108 loc) · 3.96 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
allprojects {
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'signing'
apply plugin: 'maven-publish'
}
idea {
project {
jdkName = JavaVersion.VERSION_1_8
languageLevel = JavaVersion.VERSION_1_8
vcs = "Git"
}
workspace.iws.withXml { provider ->
def junitDefaults = provider.node.component.find { it.@name == 'RunManager' }.configuration.find {
it.@type == 'JUnit'
}
junitDefaults.option.find { it.@name == 'WORKING_DIRECTORY' }.@value = '$MODULE_DIR$'
}
}
subprojects {
java {
group = 'com.github.dreamhead'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
options.compilerArgs << "-Xlint:deprecation"
}
java {
withSourcesJar()
withJavadocJar()
}
repositories {
mavenCentral()
}
project.dependencies {
implementation("com.google.guava:guava:$guavaVersion")
testImplementation("org.assertj:assertj-core:$assertJVersion")
}
apply from: "$rootDir/gradle/config/scripts/style.gradle"
apply from: "$rootDir/gradle/config/scripts/coverage.gradle"
publishing {
publications {
mavenJava(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
from components.java
pom {
name = project.name
description = 'Object bot is a library for setting up Java objects as test data.'
url = 'https://github.com/dreamhead/object-bot'
licenses {
license {
name = 'MIT Licence'
url = 'https://raw.githubusercontent.com/dreamhead/object-bot/master/MIT-LICENSE.txt'
}
}
developers {
developer {
id = 'dreamhead'
name = 'Zheng Ye'
email = '[email protected]'
}
}
scm {
connection = 'https://github.com/dreamhead/object-bot.git'
developerConnection = 'https://github.com/dreamhead/object-bot.git'
url = 'https://github.com/dreamhead/object-bot'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
project.jar {
manifest {
attributes 'Package': "com.github.dreamhead",
'Implementation-Title': "${project.name}",
'Implementation-Version': "${archiveVersion.get()}",
'Implementation-Vendor': 'Zheng Ye',
'Built-By': 'Zheng Ye',
'Built-Date': new Date().getDateTimeString(),
'Built-With': "gradle-${project.getGradle().getGradleVersion()}, groovy-${GroovySystem.getVersion()}",
'Created-By': 'Java ' + System.getProperty('java.version') + ' (' + System.getProperty('java.vendor') + ')'
}
}
}
configure(subprojects - project(':bot-core')) {
project.dependencies {
api(project(':bot-core'))
}
}