-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbuild.gradle
111 lines (95 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
project.group = "de.codeshelf.consoleui"
project.version = "0.0.13"
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile 'org.fusesource.jansi:jansi:1.11'
compile 'jline:jline:2.14.6'
}
javadoc {
options.encoding = 'UTF-8'
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
// Fat-jar
task fatJar(type: Jar, dependsOn: [':compileJava', ':processResources']) {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from sourceSets.main.output.classesDirs
from sourceSets.main.output.resourcesDir
project.archivesBaseName = project.name + '-all'
manifest {
attributes 'Implementation-Title': 'ConsoleUI',
'Implementation-Version': project.version,
'Main-Class': 'de.codeshelf.consoleui.Basic'
}
}
task printEnv {
println "username " + sonatypeUsername
}
publishing {
repositories {
mavenLocal {
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = "$buildDir/repos/releases"
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
mavenCentral {
// change URLs to point to your repos, e.g. http://my.org/repo
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
}
}
}
publications {
consoleUI(MavenPublication) {
from components.java
pom {
name = 'ConsoleUI'
description = 'Library for Ansi-Console user interaction'
url = 'https://github.com/awegmann/consoleui/'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = "an10nn";
name = "Andreas Wegmann";
email = "[email protected]";
}
}
scm {
connection = 'scm:git:git://github.com/awegmann/consoleui.git'
developerConnection = 'scm:git:ssh://[email protected]:awegmann/consoleui.git'
url = 'https://github.com/awegmann/consoleui/'
}
}
}
}
}
signing {
sign publishing.publications.consoleUI
}