This repository has been archived by the owner on Nov 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
102 lines (81 loc) · 3.57 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
/**************************************************************************************************
* Copyright (c) 2014 Dennis Fischer. *
* All rights reserved. This program and the accompanying materials *
* are made available under the terms of the GNU Public License v3.0+ *
* which accompanies this distribution, and is available at *
* http://www.gnu.org/licenses/gpl.html *
* *
* Contributors: Dennis Fischer *
**************************************************************************************************/
def javaFxHome = System.getProperty("java.home");
System.out.println(javaFxHome);
apply plugin: 'java'
apply plugin: 'application'
version = "v3.2.1.1";
mainClassName = 'de.chaosfisch.uploader.SimpleJavaYoutubeUploader'
sourceCompatibility = 1.7
targetCompatibility = 1.7
configurations {
//we do not want to have jfxrt.jar in the classpath when creating the jar,
//therefore a seperate configuration is required
providedCompile
}
dependencies {
compile 'ch.qos.logback:logback-classic:1.0.9', 'org.jfxtras:jfxtras-labs:2.2+',
'com.thoughtworks.xstream:xstream:1.4.3', 'com.google.code.gson:gson:2.2.2',
'com.cathive.fx:fx-guice:+', 'com.google.guava:guava:+',
'com.google.inject:guice:3.0', 'com.google.inject.extensions:guice-assistedinject:3.0',
'com.google.inject.extensions:guice-multibindings:3.0', 'commons-configuration:commons-configuration:+'
compile project(':google'), project(':persistence'), project(':template'), project(':util')
testCompile 'junit:junit:4.10'
providedCompile files("$javaFxHome/lib/jfxrt.jar")
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "http://maven.mashape.com/releases" }
}
compileJava {
//add required JavaFX libs to compile classpath
sourceSets.main.compileClasspath += configurations.providedCompile
getBuildDir().mkdirs()
}
jar {
archiveName = "SimpleJavaYoutubeUploader.jar"
}
task javaFXPackager(type: Exec) {
commandLine = ["$javaFxHome/../bin/javafxpackager",
'-createjar',
'-srcdir',
sourceSets.main.output.classesDir,
'-outdir',
jar.destinationDir,
'-outfile',
jar.archiveName,
'-appclass',
mainClassName,
'-nocss2bin',
'-classpath',
configurations.runtime.collect { "lib/" + it.name }.join(' '),
'-manifestAttrs',
'Implementation-Title=Simple Java Youtube Uploader ' + version + ',Implementation-Version=' + version + ',Implementation-Vendor=Dennis Fischer aka CHAOSFISCH,' + 'Built-By=' + System.getProperty('user.name') + ',Built-Date=' + new Date() + ',Built-JDK=' + System.getProperty('java.version')]
}
task copyTask(type: Copy) {
from sourceSets.main.output.resourcesDir
into sourceSets.main.output.classesDir
}
task distribute(type: Zip) {
file("$buildDir/SimpleJavaYoutubeUploader.vmoptions").createNewFile()
baseName 'simple-java-youtube-uploader'
from("$jar.destinationDir$File.separator${jar.archiveName}")
from("$buildDir/SimpleJavaYoutubeUploader.vmoptions")
into("lib") {
from(project.configurations.runtime)
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
distribute.dependsOn javaFXPackager
javaFXPackager.dependsOn copyTask
copyTask.dependsOn build