nxt gradle build script for publishing insert maven repo file and unco

  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
/*
nxt gradle build script
for publishing
- insert maven repo file and uncomment section
*/
defaultTasks 'clean', 'stage', 'publish'
group = 'org.nxt'
version = '1.2.6'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'maven'
apply plugin: 'maven-publish'
mainClassName = "nxt.Nxt"
applicationName = "NxtNode"
//load properties from conf directory
def defaultprops = new Properties()
file("conf/nxt-default.properties").withInputStream {
stream -> defaultprops.load(stream)
}
task printprops {
println "nxt default properties "
defaultprops.each{ k, v -> println "${k} : ${v}" }
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.h2database:h2:1.3.176'
compile 'org.bouncycastle:bcprov-jdk14:1.51'
compile 'org.eclipse.jetty:jetty-continuation:9.2.2.v20140723'
compile 'org.eclipse.jetty:jetty-http:9.2.2.v20140723'
compile 'org.eclipse.jetty:jetty-io:9.2.2.v20140723'
compile 'org.eclipse.jetty:jetty-security:9.2.2.v20140723'
compile 'org.eclipse.jetty:jetty-server:9.2.2.v20140723'
compile 'org.eclipse.jetty:jetty-servlet:9.2.2.v20140723'
compile 'org.eclipse.jetty:jetty-servlets:9.2.2.v20140723'
compile 'org.eclipse.jetty:jetty-util:9.2.2.v20140723'
compile 'com.googlecode.json-simple:json-simple:1.1.1'
compile 'javax.servlet:javax.servlet-api:3.1.0'
compile 'org.slf4j:slf4j-api:1.7.7'
compile 'org.slf4j:slf4j-jdk14:1.7.7'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
sourceCompatibility = 1.7
sourceSets {
main {
java {
srcDir 'src/java'
}
}
}
task njar(type: Jar) {
from files(sourceSets.main.output.classesDir)
archiveName = "nxt.jar"
destinationDir = file("./")
manifest {
attributes 'Main-Class': 'nxt.Nxt'
}
}
task stage(dependsOn: ['build', 'njar'])
task fatJar(type: Jar) {
baseName = project.name + '-all'
from (configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }){
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
with jar
manifest.attributes("Main-Class":"nxt.Nxt")
}
configurations {
standard
}
task runnxt(type: JavaExec) {
classpath configurations.standard
main = "nxt.Nxt"
}
/*publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file:///XXXX"
}
}
}*/