jSerialComm/build.gradle

75 lines
1.9 KiB
Groovy
Raw Normal View History

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'osgi'
2015-03-17 10:18:08 -07:00
group = 'com.fazecast'
archivesBaseName = 'jSerialComm'
2018-01-03 14:13:40 -08:00
version = '2.0.0'
assert hasProperty('javaHome'): "Set the property 'javaHome' in your gradle.properties file pointing to a Java 6 JDK installation"
sourceCompatibility = 1.6
targetCompatibility = 1.6
2018-01-03 14:13:40 -08:00
javadoc.options.links("http://docs.oracle.com/javase/8/docs/api/")
def javaExecutablesPath = new File(javaHome, 'bin')
def javaExecutables = [:].withDefault { execName ->
def executable = new File(javaExecutablesPath, execName)
executable
}
tasks.withType(AbstractCompile) {
options.with {
fork = true
forkOptions.javaHome = file(javaHome)
}
}
tasks.withType(Javadoc) {
executable = javaExecutables.javadoc
}
tasks.withType(Test) {
executable = javaExecutables.java
}
tasks.withType(JavaExec) {
executable = javaExecutables.java
}
jar {
manifest {
instruction 'Bundle-Description', 'Java Serial Communications Library'
instruction 'Bundle-Vendor', 'Fazecast, Inc.'
attributes 'Implementation-Title': 'jSerialComm: Java Serial Communications Library',
'Implementation-Version': version,
'Implementation-Vendor': 'Fazecast, Inc.',
'Sealed': 'true'
}
}
task testJar(type: Jar) {
classifier = 'test'
from sourceSets.test.output, sourceSets.main.output
manifest {
attributes 'Main-Class': 'com.fazecast.jSerialComm.SerialPortTest',
'Implementation-Title': 'jSerialComm: Java Serial Communications Library',
'Implementation-Version': version,
'Implementation-Vendor': 'Fazecast, Inc.',
'Sealed': 'true'
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar, javadocJar, sourcesJar, testJar
}