This repository was archived by the owner on Oct 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
187 lines (154 loc) · 5.58 KB
/
build.gradle
File metadata and controls
187 lines (154 loc) · 5.58 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
import org.apache.tools.ant.filters.ReplaceTokens
ext {
getBuildNumber = { ->
return file('./buildNumber.txt').text as Integer
}
incrementBuildNumber = { ->
File file = file('./buildNumber.txt')
int buildNumber = ++(file.text as Integer)
file.text = buildNumber
}
}
/*task incrementBuildNumber {
File file = file('./buildNumber.txt')
int buildNumber = ++(file.text as Integer)
file.text = buildNumber
}*/
allprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group 'com.jesus-crie'
version('2.5.0_' + getBuildNumber())
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
archivesBaseName = name
ext {
name = 'ModularBot'
nightConfigVersion = '3.6.0' // Change in the readme too line 231.
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
testImplementation "org.junit.platform:junit-platform-gradle-plugin:1.2.0"
testImplementation 'org.junit.platform:junit-platform-launcher:1.2.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.2.0'
testImplementation 'org.hamcrest:hamcrest-junit:2.0.0.0'
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
}
project(':modularbot-core') {
ext.name = 'ModularBot - Core'
project.description = 'A java framework based on JDA that helps you create your discord bot.'
task sourcesForRelease(type: Copy) {
from './ModularBot-Core/src/main/java'
into './ModularBot-Core/build/filteredSrc'
filter(ReplaceTokens, tokens: [
versionName : version,
versionBuild: getBuildNumber()
])
}
compileJava {
options.compilerArgs += ["-parameters"]
}
}
project(':modularbot-logger') {
ext.name = 'ModularBot - Logger'
project.description = 'Module with a default implementation of SLF4J.'
}
project(':modularbot-command') {
ext.name = 'ModularBot - Command'
project.description = 'Module that enable the support of commands.'
}
project(':modularbot-night-config-wrapper') {
ext.name = 'ModularBot - Night Config Wrapper'
project.description = 'A wrapper of https://github.com/TheElectronWill/Night-Config .'
}
project(':modularbot-nashorn-support') {
ext.name = 'ModularBot - JS Nashorn Support'
project.description = 'Module that can load modules in JavaScript.'
}
project(':modularbot-nashorn-command-support') {
ext.name = 'ModularBot - JS Nashorn Command Support'
project.description = 'Extension of the JS module that supports the command module.'
}
project(':modularbot-message-decorator') {
ext.name = 'ModularBot - Message Decorator'
project.description = 'Module that can bind to specific messages and extends their behaviour.'
}
project(':modularbot-graalvm-support') {
ext.name = 'ModularBot - GraalVM Support'
project.description = 'Module that enable the support of module written in any languages supported by GraalVM.'
}
project(':modularbot-graalvm-support-discordjs') {
ext.name = 'ModularBot - GraalVM Support DJS'
project.description = 'Extension to the GraalVM module that emulates the DiscordJS API.'
}
subprojects {
artifacts {
archives javadocJar
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = project.ext.name
description = project.description
url = 'https://github.com/JesusCrie/ModularBot'
developers {
developer {
id = 'com.jesus_crie'
name = 'Lucas Malandrino'
email = 'lucas.malandrino@gmail.com'
url = 'https://github.com/JesusCrie'
}
}
licenses {
license {
name = 'GNU General Public License v3.0'
url = 'https://opensource.org/licenses/GPL-3.0'
}
}
scm {
connection = 'scm:git:git://github.com/JesusCrie/ModularBot_v2.git'
developerConnection = 'scm:git:ssh://github.com/JesusCrie/ModularBot.git'
url = 'https://github.com/JesusCrie/ModularBot'
}
}
}
}
repositories {
maven {
credentials {
username = ossrhUsername
password = ossrhPassword
}
def releaseRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotRepoUrl : releaseRepoUrl
}
}
}
signing {
sign publishing.publications.mavenJava
}
}