-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
389 lines (66 loc) · 2.08 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
apply plugin:'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.6
targetCompatibility = 1.6
version = '2.6'
project.ext.baseName = 'tightvnc-jviewer'
defaultTasks 'clean', 'dist'
configurations {
viewerSwingCompile { extendsFrom compile }
viewerSwingRuntime { extendsFrom viewerSwingCompile, runtime }
}
sourceSets {
viewerSwing {
java {
srcDir 'src/viewer_swing/java'
}
resources {
srcDir 'src/viewer_swing/resources'
}
}
main {
java.srcDirs += viewerSwing.java.srcDirs
resources.srcDirs += viewerSwing.resources.srcDirs
}
}
repositories {
mavenCentral()
}
dependencies {
viewerSwingCompile group: 'com.jcraft', name: 'jsch', version: '0.1.+'
viewerSwingRuntime configurations.viewerSwingCompile
compile group: 'com.jcraft', name: 'jsch', version: '0.1.+'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
jar {
baseName = project.baseName
version = null
manifest {
attributes 'Main-Class': 'com.glavsoft.viewer.Viewer'
attributes 'Implementation-Version': "${project.version}"
}
// make fat jar with Jsch classes added (using task noJsch prevents adding these a classes)
gradle.taskGraph.whenReady { graph ->
if ( ! graph.hasTask(noJsch)) {
def runtimeDeps = configurations.viewerSwingRuntime.collect {
it.isDirectory() ? it : zipTree(it)
}
from(runtimeDeps) {
exclude 'META-INF/**'
}
}
}
}
task noJsch
artifacts {
archives file('src/web/viewer-applet-example.html')
}
uploadArchives {
repositories {
ivy {
artifactPattern "$projectDir/dist/${project.baseName}-${project.version}/[artifact].[ext]"
}
}
uploadDescriptor = false
}
task dist(dependsOn: uploadArchives)