2018-06-30 19:36:50 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2018 dorkbox, llc
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2018-07-23 05:02:13 +02:00
|
|
|
|
|
|
|
import java.nio.file.Paths
|
2018-06-20 17:13:10 +02:00
|
|
|
import java.time.Instant
|
|
|
|
|
2018-07-23 05:02:13 +02:00
|
|
|
buildscript {
|
|
|
|
// load properties from custom location
|
|
|
|
def propsFile = Paths.get("${projectDir}/../../gradle.properties").toAbsolutePath().normalize().toFile()
|
|
|
|
println("Loading custom property data from: ${propsFile}")
|
|
|
|
|
|
|
|
def props = new Properties()
|
|
|
|
propsFile.withInputStream {props.load(it)}
|
2018-08-13 00:23:25 +02:00
|
|
|
props.each {key, val -> project.ext.set(key, val)}
|
2018-07-23 05:02:13 +02:00
|
|
|
|
2018-08-13 00:23:25 +02:00
|
|
|
// for plugin publishing and license sources
|
2018-07-23 05:02:13 +02:00
|
|
|
repositories {
|
2018-08-13 00:23:25 +02:00
|
|
|
maven {url "https://plugins.gradle.org/m2/"}
|
2018-07-23 05:02:13 +02:00
|
|
|
}
|
|
|
|
dependencies {
|
2018-08-13 00:23:25 +02:00
|
|
|
// this is the only way to also get the source code for IDE auto-complete
|
|
|
|
classpath "gradle.plugin.com.dorkbox:Licensing:1.2.2"
|
|
|
|
classpath "gradle.plugin.com.dorkbox:Licensing:1.2.2:sources"
|
2018-07-23 05:02:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-20 17:13:10 +02:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
|
|
|
id 'maven-publish'
|
|
|
|
id 'signing'
|
2018-07-17 21:42:38 +02:00
|
|
|
|
2018-08-13 00:23:25 +02:00
|
|
|
id "com.dorkbox.CrossCompile" version "1.0.1"
|
2018-08-13 20:00:24 +02:00
|
|
|
id "com.dorkbox.VersionUpdate" version "1.1"
|
2018-06-20 17:13:10 +02:00
|
|
|
}
|
|
|
|
|
2018-08-13 00:23:25 +02:00
|
|
|
// this is the only way to also get the source code for IDE auto-complete
|
|
|
|
apply plugin: "com.dorkbox.Licensing"
|
|
|
|
|
2018-06-20 17:13:10 +02:00
|
|
|
apply from: '../Utilities/gradle/swt.gradle'
|
|
|
|
|
|
|
|
group = 'com.dorkbox'
|
2018-07-17 21:42:38 +02:00
|
|
|
version = '3.14'
|
2018-06-20 17:13:10 +02:00
|
|
|
description = 'Cross-platform SystemTray support for Swing/AWT, GtkStatusIcon, and AppIndicator on Java 6+'
|
|
|
|
|
|
|
|
static String[] javaFile(String... fileNames) {
|
|
|
|
def fileList = [] as ArrayList
|
|
|
|
|
|
|
|
for (name in fileNames) {
|
|
|
|
def fixed = name.replace('.', '/') + '.java'
|
|
|
|
fileList.add(fixed)
|
|
|
|
}
|
|
|
|
|
|
|
|
return fileList
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
swtExampleJar
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
setSrcDirs Collections.singletonList('src')
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
setSrcDirs Collections.singletonList('src')
|
|
|
|
include 'dorkbox/systemTray/gnomeShell/extension.js',
|
|
|
|
'dorkbox/systemTray/util/error_32.png'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
java {
|
|
|
|
setSrcDirs Collections.singletonList('test')
|
|
|
|
|
|
|
|
// this is required because we reset the srcDirs to 'test' above, and 'main' must manually be added back
|
|
|
|
srcDir main.java
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
setSrcDirs Collections.singletonList('test')
|
|
|
|
include 'dorkbox/*.png'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
swingExample {
|
|
|
|
java {
|
|
|
|
setSrcDirs Collections.singletonList('test')
|
|
|
|
include javaFile('dorkbox.TestTray',
|
2018-06-20 17:29:09 +02:00
|
|
|
'dorkbox.CustomSwingUI')
|
2018-06-20 17:13:10 +02:00
|
|
|
srcDir main.java
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
setSrcDirs Collections.singletonList('test')
|
|
|
|
include 'dorkbox/*.png'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
javaFxExample {
|
|
|
|
java {
|
|
|
|
setSrcDirs Collections.singletonList('test')
|
|
|
|
include javaFile('dorkbox.TestTray',
|
2018-06-20 17:29:09 +02:00
|
|
|
'dorkbox.TestTrayJavaFX',
|
|
|
|
'dorkbox.CustomSwingUI')
|
2018-06-20 17:13:10 +02:00
|
|
|
srcDir main.java
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
setSrcDirs Collections.singletonList('test')
|
|
|
|
include 'dorkbox/*.png'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
swtExample {
|
|
|
|
java {
|
|
|
|
setSrcDirs Collections.singletonList('test')
|
|
|
|
include javaFile('dorkbox.TestTray',
|
2018-06-20 17:29:09 +02:00
|
|
|
'dorkbox.TestTraySwt',
|
|
|
|
'dorkbox.CustomSwingUI')
|
2018-06-20 17:13:10 +02:00
|
|
|
srcDir main.java
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
setSrcDirs Collections.singletonList('test')
|
|
|
|
include 'dorkbox/*.png'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenLocal() // this must be first!
|
|
|
|
|
|
|
|
maven {
|
|
|
|
// because the eclipse release of SWT is abandoned on maven, this MAVEN repo has newer version of SWT,
|
|
|
|
url 'http://maven-eclipse.github.io/maven'
|
|
|
|
}
|
2018-06-30 19:36:50 +02:00
|
|
|
jcenter()
|
2018-06-20 17:13:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2018-08-17 23:54:49 +02:00
|
|
|
compile(project('Utilities')) {
|
2018-06-20 17:13:10 +02:00
|
|
|
// don't include any of the project dependencies for anything
|
|
|
|
transitive = false
|
|
|
|
}
|
|
|
|
|
|
|
|
// our main dependencies are ALSO the same as the limited utilities (they are not automatically pulled in from other sourceSets)
|
|
|
|
// needed by the utilities (custom since we don't want to include everything). IntelliJ includes everything, but our builds do not
|
2018-08-13 00:23:25 +02:00
|
|
|
|
2018-08-13 18:36:06 +02:00
|
|
|
compile 'com.dorkbox:ShellExecutor:1.1+'
|
2018-08-13 00:23:25 +02:00
|
|
|
|
2018-08-17 23:54:49 +02:00
|
|
|
compile 'org.javassist:javassist:3.23.0-GA'
|
|
|
|
compile 'net.java.dev.jna:jna:4.3.0'
|
|
|
|
compile 'net.java.dev.jna:jna-platform:4.3.0'
|
2018-08-13 18:36:06 +02:00
|
|
|
compile 'org.slf4j:slf4j-api:1.7.25'
|
2018-06-20 17:13:10 +02:00
|
|
|
|
|
|
|
|
2018-08-13 18:36:06 +02:00
|
|
|
def log = runtime 'ch.qos.logback:logback-classic:1.1.6'
|
2018-06-20 17:13:10 +02:00
|
|
|
|
|
|
|
// because the eclipse release of SWT is abandoned on maven, this repo has a newer version of SWT,
|
|
|
|
// http://maven-eclipse.github.io/maven
|
|
|
|
// 4.4 is the oldest version that works with us. We use reflection to access SWT, so we can compile the project without needing SWT
|
|
|
|
def swtDep = testCompileOnly(group: 'org.eclipse.swt', name: "org.eclipse.swt.gtk.${swtPlatform}.${swtArch}", version: '4.4+')
|
|
|
|
|
|
|
|
// JavaFX isn't always added to the compile classpath....
|
2018-06-30 19:36:50 +02:00
|
|
|
testImplementation files("${System.getProperty('java.home', '.')}/lib/ext/jfxrt.jar")
|
2018-06-20 17:13:10 +02:00
|
|
|
|
|
|
|
// dependencies for our test examples
|
2018-06-30 19:36:50 +02:00
|
|
|
swingExampleImplementation configurations.compile, log
|
|
|
|
javaFxExampleImplementation configurations.compile, log
|
|
|
|
swtExampleImplementation configurations.compile, log, swtDep
|
2018-06-20 17:13:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
project('Utilities') {
|
|
|
|
tasks.withType(Test) {
|
|
|
|
// want to remove utilities project from unit tests. It's unnecessary to run unit tests for the entire Utilities project
|
|
|
|
exclude('**/*')
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
options.incremental = true
|
|
|
|
options.fork = true
|
|
|
|
options.forkOptions.executable = 'javac'
|
|
|
|
|
|
|
|
// setup compile options. we specifically want to suppress usage of "Unsafe"
|
|
|
|
options.compilerArgs = ['-XDignore.symbol.file', '-Xlint:deprecation']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// Task defaults
|
|
|
|
///////////////////////////////
|
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
|
2018-06-20 17:29:09 +02:00
|
|
|
// options.bootstrapClasspath = files("/jre/lib/rt.jar")
|
2018-06-20 17:13:10 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_6
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_6
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(Jar) {
|
|
|
|
duplicatesStrategy DuplicatesStrategy.FAIL
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes['Implementation-Version'] = version
|
|
|
|
attributes['Build-Date'] = Instant.now().toString()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// UTILITIES COMPILE (for inclusion into jars)
|
|
|
|
///////////////////////////////
|
|
|
|
task compileUtils(type: JavaCompile) {
|
|
|
|
// we don't want the default include of **/*.java
|
|
|
|
getIncludes().clear()
|
|
|
|
|
|
|
|
source = Collections.singletonList('../Utilities/src')
|
|
|
|
include javaFile('dorkbox.util.SwingUtil',
|
2018-06-20 17:29:09 +02:00
|
|
|
'dorkbox.util.OS',
|
|
|
|
'dorkbox.util.OSUtil',
|
|
|
|
'dorkbox.util.OSType',
|
|
|
|
'dorkbox.util.ImageResizeUtil',
|
|
|
|
'dorkbox.util.ImageUtil',
|
|
|
|
'dorkbox.util.CacheUtil',
|
|
|
|
'dorkbox.util.IO',
|
|
|
|
'dorkbox.util.JavaFX',
|
|
|
|
'dorkbox.util.Property',
|
|
|
|
'dorkbox.util.Keep',
|
|
|
|
'dorkbox.util.FontUtil',
|
|
|
|
'dorkbox.util.ScreenUtil',
|
|
|
|
'dorkbox.util.ClassLoaderUtil',
|
|
|
|
'dorkbox.util.Swt',
|
|
|
|
'dorkbox.util.NamedThreadFactory',
|
|
|
|
'dorkbox.util.ActionHandlerLong',
|
|
|
|
'dorkbox.util.FileUtil',
|
|
|
|
'dorkbox.util.MathUtil',
|
|
|
|
'dorkbox.util.LocationResolver',
|
|
|
|
'dorkbox.util.Desktop')
|
2018-06-20 17:13:10 +02:00
|
|
|
|
|
|
|
// entire packages/directories
|
|
|
|
include('dorkbox/util/jna/**/*.java')
|
|
|
|
include('dorkbox/util/windows/**/*.java')
|
|
|
|
include('dorkbox/util/swing/**/*.java')
|
|
|
|
|
|
|
|
classpath = sourceSets.main.compileClasspath
|
|
|
|
destinationDir = file("$rootDir/build/classes_utilities")
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// Tasks to launch examples from gradle
|
|
|
|
///////////////////////////////
|
|
|
|
task swingExample(type: JavaExec) {
|
|
|
|
classpath sourceSets.swingExample.runtimeClasspath
|
|
|
|
main = 'dorkbox.TestTray'
|
|
|
|
standardInput = System.in
|
|
|
|
}
|
|
|
|
|
|
|
|
task javaFxExample(type: JavaExec) {
|
|
|
|
classpath sourceSets.javaFxExample.runtimeClasspath
|
|
|
|
main = 'dorkbox.TestTrayJavaFX'
|
|
|
|
standardInput = System.in
|
|
|
|
}
|
|
|
|
|
|
|
|
task swtExample(type: JavaExec) {
|
|
|
|
classpath sourceSets.swtExample.runtimeClasspath
|
|
|
|
|
|
|
|
main = 'dorkbox.TestTraySwt'
|
|
|
|
standardInput = System.in
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// Jar Tasks
|
|
|
|
///////////////////////////////
|
|
|
|
jar {
|
|
|
|
dependsOn compileUtils
|
|
|
|
|
|
|
|
// include applicable class files from subset of Utilities project
|
|
|
|
from compileUtils.destinationDir
|
|
|
|
}
|
|
|
|
|
|
|
|
task jarSwingExample(type: Jar) {
|
|
|
|
dependsOn jar
|
|
|
|
|
|
|
|
baseName = 'SystemTray-SwingExample'
|
|
|
|
group = BasePlugin.BUILD_GROUP
|
|
|
|
description = 'Create an all-in-one example for testing, using Swing'
|
|
|
|
|
|
|
|
from sourceSets.swingExample.output.classesDirs
|
|
|
|
from sourceSets.swingExample.output.resourcesDir
|
|
|
|
|
|
|
|
// add all of the main project jars as a fat-jar for all examples, exclude the Utilities.jar contents
|
|
|
|
from configurations.compile.filter { it.name == 'Utilities.jar' ? null : it }
|
|
|
|
.collect { it.directory ? it : zipTree(it) }
|
|
|
|
|
|
|
|
// include applicable class files from subset of Utilities project
|
|
|
|
from compileUtils.destinationDir
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes['Main-Class'] = 'dorkbox.TestTray'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
task jarJavaFxExample(type: Jar) {
|
|
|
|
dependsOn jar
|
|
|
|
|
|
|
|
baseName = 'SystemTray-JavaFxExample'
|
|
|
|
group = BasePlugin.BUILD_GROUP
|
|
|
|
description = 'Create an all-in-one example for testing, using JavaFX'
|
|
|
|
|
|
|
|
from sourceSets.javaFxExample.output.classesDirs
|
|
|
|
from sourceSets.javaFxExample.output.resourcesDir
|
|
|
|
|
|
|
|
// add all of the main project jars as a fat-jar for all examples, exclude the Utilities.jar contents
|
|
|
|
from configurations.compile.filter { it.name == 'Utilities.jar' ? null : it }
|
|
|
|
.collect { it.directory ? it : zipTree(it) }
|
|
|
|
|
|
|
|
// include applicable class files from subset of Utilities project
|
|
|
|
from compileUtils.destinationDir
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes['Main-Class'] = 'dorkbox.TestTrayJavaFX'
|
|
|
|
attributes['Class-Path'] = "${System.getProperty('java.home', '.')}/lib/ext/jfxrt.jar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task jarSwtExample(type: Jar) {
|
|
|
|
dependsOn jar
|
|
|
|
|
|
|
|
baseName = 'SystemTray-SwtExample'
|
|
|
|
group = BasePlugin.BUILD_GROUP
|
|
|
|
description = 'Create an all-in-one example for testing, using SWT'
|
|
|
|
|
|
|
|
from sourceSets.swtExample.output.classesDirs
|
|
|
|
from sourceSets.swtExample.output.resourcesDir
|
|
|
|
|
|
|
|
// add all of the main project jars as a fat-jar for all examples, exclude the Utilities.jar contents
|
|
|
|
from configurations.compile.filter { it.name == 'Utilities.jar' ? null : it }
|
2018-06-20 17:29:09 +02:00
|
|
|
.collect { it.directory ? it : zipTree(it) }
|
2018-06-20 17:13:10 +02:00
|
|
|
|
|
|
|
// include applicable class files from subset of Utilities project
|
|
|
|
from compileUtils.destinationDir
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes['Main-Class'] = 'dorkbox.TestTraySwt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
task jarAllExamples {
|
|
|
|
dependsOn jarSwingExample
|
|
|
|
dependsOn jarJavaFxExample
|
|
|
|
dependsOn jarSwtExample
|
|
|
|
|
|
|
|
group = BasePlugin.BUILD_GROUP
|
|
|
|
description = 'Create all-in-one examples for testing, using Swing, JavaFX, and SWT'
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////
|
2018-08-13 00:23:25 +02:00
|
|
|
////// Maven Publishing + Release
|
|
|
|
///////////////////////////////
|
|
|
|
//task sourceJar(type: Jar) {
|
|
|
|
// description = "Creates a JAR that contains the source code."
|
|
|
|
//
|
|
|
|
// from sourceSets.main.allSource
|
|
|
|
//
|
|
|
|
// classifier = "sources"
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//task javaDocJar(type: Jar) {
|
|
|
|
// description = "Creates a JAR that contains the javadocs."
|
|
|
|
//
|
|
|
|
// classifier = "javadoc"
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//// for testing, we don't publish to maven central, but only to local maven
|
|
|
|
//publishing {
|
|
|
|
// publications {
|
|
|
|
// CrossCompile(MavenPublication) {
|
|
|
|
// from components.java
|
|
|
|
//
|
|
|
|
// artifact(javaDocJar)
|
|
|
|
// artifact(sourceJar)
|
|
|
|
//
|
|
|
|
// groupId project.group
|
|
|
|
// artifactId project.ext.id
|
|
|
|
// version project.version
|
|
|
|
//
|
|
|
|
// pom {
|
|
|
|
// withXml {
|
|
|
|
// // eliminate logback compile dependencies (no need in maven central POMs)
|
|
|
|
// def root = asNode()
|
|
|
|
//
|
|
|
|
// root.dependencies.'*'.findAll() {
|
|
|
|
// it.groupId.text() == "ch.qos.logback" && it.artifactId.text() == "logback-classic"
|
|
|
|
// }.each() {
|
|
|
|
// it.parent().remove(it)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// name = project.ext.id
|
|
|
|
// url = project.ext.url
|
|
|
|
// description = project.description
|
|
|
|
//
|
|
|
|
// issueManagement {
|
|
|
|
// url = "${project.ext.url}/issues".toString()
|
|
|
|
// system = 'Gitea Issues'
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// organization {
|
|
|
|
// name = 'dorkbox, llc'
|
|
|
|
// url = 'https://dorkbox.com'
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// developers {
|
|
|
|
// developer {
|
|
|
|
// name = 'dorkbox, llc'
|
|
|
|
// email = 'email@dorkbox.com'
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// scm {
|
|
|
|
// url = project.ext.url
|
|
|
|
// connection = "scm:${project.ext.url}.git".toString()
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// repositories {
|
|
|
|
// maven {
|
|
|
|
// url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
|
|
|
|
// credentials {
|
|
|
|
// username sonatypeUsername
|
|
|
|
// password sonatypePassword
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//signing {
|
|
|
|
// required {hasProperty('sonatypeUsername')}
|
|
|
|
// sign publishing.publications.CrossCompile
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//// we don't use maven with the plugin (it's uploaded separately to gradle plugins)
|
|
|
|
//tasks.withType(PublishToMavenRepository) {
|
|
|
|
// onlyIf {
|
|
|
|
// repository == publishing.repositories.maven && publication == publishing.publications.CrossCompile
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//tasks.withType(PublishToMavenLocal) {
|
|
|
|
// onlyIf {
|
|
|
|
// publication == publishing.publications.CrossCompile
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// OLD Publishing. NEWER IS ABOVE BUT NEEDS TWEAKING
|
2018-06-20 17:13:10 +02:00
|
|
|
///////////////////////////////
|
|
|
|
task sourceJar(type: Jar) {
|
|
|
|
description = "Creates a JAR that contains the source code."
|
|
|
|
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
from compileUtils.source
|
|
|
|
|
|
|
|
classifier = "sources"
|
|
|
|
}
|
|
|
|
|
|
|
|
task javaDocJar(type: Jar) {
|
|
|
|
description = "Creates a JAR that contains the javadocs."
|
|
|
|
|
|
|
|
classifier = "javadoc"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
from components.java
|
|
|
|
|
|
|
|
pom {
|
|
|
|
// remove the Utilities project from the pom (since we include the relevant source, a custom jar is not necessary)
|
|
|
|
// This is run AFTER the pom data is put together, and just before written to disk
|
|
|
|
withXml {
|
2018-07-17 21:42:38 +02:00
|
|
|
def root = asNode()
|
|
|
|
|
|
|
|
root.dependencies.'*'.findAll() {
|
|
|
|
it.artifactId.text() == "Utilities"
|
|
|
|
}.each() {
|
|
|
|
it.parent().remove(it)
|
2018-06-20 17:13:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-17 21:42:38 +02:00
|
|
|
|
|
|
|
|
2018-06-20 17:13:10 +02:00
|
|
|
url = 'https://git.dorkbox.com/dorkbox/SystemTray'
|
|
|
|
description = this.description
|
|
|
|
|
|
|
|
// properties {
|
|
|
|
//// sourceEncoding = 'UTF-8'
|
|
|
|
//// ['maven.compiler.source'] = '6'
|
|
|
|
//// maven.compiler.target = 6
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// properties['maven.compiler.source'] = '6'
|
|
|
|
|
|
|
|
issueManagement {
|
|
|
|
url = 'https://git.dorkbox.com/dorkbox/SystemTray'
|
|
|
|
system = 'Gitea Issues'
|
|
|
|
}
|
|
|
|
|
|
|
|
// licenses {
|
|
|
|
// license {
|
|
|
|
// name = 'The Apache License, Version 2.0'
|
|
|
|
// url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// developers {
|
|
|
|
// developer {
|
|
|
|
// id = 'johnd'
|
|
|
|
// name = 'John Doe'
|
|
|
|
// email = 'john.doe@example.com'
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// scm {
|
|
|
|
// connection = 'scm:git:git://example.com/my-library.git'
|
|
|
|
// developerConnection = 'scm:git:ssh://example.com/my-library.git'
|
|
|
|
// url = 'http://example.com/my-library/'
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
|
|
<developers>
|
|
|
|
<developer>
|
|
|
|
<name>Dorkbox</name>
|
|
|
|
<email>sonatype@dorkbox.com</email>
|
|
|
|
<organization>Dorkbox</organization>
|
|
|
|
<organizationUrl>https://github.com/dorkbox</organizationUrl>
|
|
|
|
</developer>
|
|
|
|
</developers>
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
artifactId = 'SystemTray'
|
|
|
|
|
|
|
|
artifact(javaDocJar)
|
|
|
|
artifact(sourceJar)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-30 19:36:50 +02:00
|
|
|
//uploadArchives {
|
|
|
|
// repositories {
|
|
|
|
// mavenDeployer {
|
|
|
|
// beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
2018-06-20 17:13:10 +02:00
|
|
|
|
2018-06-30 19:36:50 +02:00
|
|
|
//
|
|
|
|
//uploadArchives {
|
|
|
|
// repositories.mavenDeployer {
|
|
|
|
// configuration = configurations.deployerJars
|
|
|
|
// repository(url: "scp://<url-of-your-webserver>/<path-to-maven-directory>") {
|
|
|
|
// authentication(userName: "ssh-username", privateKey: "<path-to-private-key-file")
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
//
|
2018-06-20 17:13:10 +02:00
|
|
|
signing {
|
|
|
|
sign publishing.publications.mavenJava
|
|
|
|
}
|
|
|
|
|
|
|
|
//gradle.taskGraph.whenReady { taskGraph ->
|
|
|
|
// if (taskGraph.allTasks.any { it instanceof Sign }) {
|
|
|
|
// // Use Java 6's console to read from the console (no good for a CI environment)
|
|
|
|
// Console console = System.console()
|
|
|
|
// console.printf "\n\nWe have to sign some things in this build." +
|
|
|
|
// "\n\nPlease enter your signing details.\n\n"
|
|
|
|
//
|
|
|
|
// def id = console.readLine("PGP Key Id: ")
|
|
|
|
// def file = console.readLine("PGP Secret Key Ring File (absolute path): ")
|
|
|
|
// def password = console.readPassword("PGP Private Key Password: ")
|
|
|
|
//
|
|
|
|
// ext.signing.keyId = 24875D73
|
|
|
|
// signing.password = secret
|
|
|
|
// signing.secretKeyRingFile = '/Users/ me / . gnupg / secring.gpg'
|
|
|
|
//
|
|
|
|
// allprojects { ext."signing.keyId" = id }
|
|
|
|
// allprojects { ext."signing.secretKeyRingFile" = file }
|
|
|
|
// allprojects { ext."signing.password" = password }
|
|
|
|
//
|
|
|
|
// console.printf "\nThanks.\n\n"
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//signing {
|
|
|
|
// sign publishing.publications
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
2018-06-20 17:29:09 +02:00
|
|
|
//def props = new Properties()
|
|
|
|
//file('../../sonatype.properties').withInputStream { props.load(it) }
|
|
|
|
//
|
|
|
|
//task printProps {
|
|
|
|
// doFirst {
|
|
|
|
// println props.getProperty('developerName')
|
|
|
|
// }
|
|
|
|
//}
|
2018-06-20 17:13:10 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
//tasks {
|
|
|
|
// // Disable publication on root project
|
|
|
|
// "artifactoryPublish"(ArtifactoryTask::class) {
|
|
|
|
// skip = true
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
//artifactory {
|
|
|
|
// setContextUrl("https://repo.gradle.org/gradle")
|
|
|
|
// publish(delegateClosureOf<PublisherConfig> {
|
|
|
|
// repository(delegateClosureOf<GroovyObject> {
|
|
|
|
// val targetRepoKey = "libs-${buildTagFor(project.version as String)}s-local"
|
|
|
|
// setProperty("repoKey", targetRepoKey)
|
|
|
|
// setProperty("username", project.findProperty("artifactory_user") ?: "nouser")
|
|
|
|
// setProperty("password", project.findProperty("artifactory_password") ?: "nopass")
|
|
|
|
// setProperty("maven", true)
|
|
|
|
// })
|
|
|
|
// defaults(delegateClosureOf<GroovyObject> {
|
|
|
|
// invokeMethod("publications", "mavenJava")
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// resolve(delegateClosureOf<ResolverConfig> {
|
|
|
|
// setProperty("repoKey", "repo")
|
|
|
|
// })
|
|
|
|
//}
|