-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
76 lines (60 loc) · 1.8 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
import org.apache.tools.ant.filters.ReplaceTokens
group 'com.lousylynx'
version '1.0'
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'idea'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
configurations {
fatjar
}
dependencies {
// testCompile group: 'junit', name: 'junit', version: '4.12'
fatjar 'commons-cli:commons-cli:1.4'
fatjar 'commons-io:commons-io:2.4'
fatjar group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8.2'
fatjar group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
compile group: 'org.fusesource.jansi', name: 'jansi', version: '1.16'
compileOnly 'org.projectlombok:lombok:1.16.18'
configurations.compile.extendsFrom(configurations.fatjar)
}
jar {
include '**'
exclude 'com/lousylynx/asciidots/cli/**'
}
task sourcesForRelease(type: Copy) {
from 'src/main/java'
into 'build/adjustedSrc'
filter(ReplaceTokens, tokens: [VERSION: project.version])
}
task compileForRelease(type: JavaCompile, dependsOn: sourcesForRelease) {
source = sourcesForRelease.destinationDir
classpath = sourceSets.main.compileClasspath
destinationDir = file('build/adjustedClasses')
}
task cliJar(type: Jar, dependsOn: [':compileForRelease', ':sourcesForRelease']) {
manifest {
attributes 'Main-Class': 'com.lousylynx.asciidots.cli.ADCLI',
'Class-Path': 'libs/* libs/jansi.jar'
}
from configurations.fatjar.collect { it.isDirectory() ? it : zipTree(it) }
from compileForRelease.destinationDir
include '**'
exclude 'META-INF/**'
include 'META-INF/MANIFEST.MF'
classifier 'cli'
}
artifacts {
archives cliJar
archives jar
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}