Mercurial > hg > Members > kono > WifiBroadcast
diff build.gradle @ 27:12633f67f3cf default tip
jar
author | oshiro |
---|---|
date | Wed, 28 Nov 2018 18:28:39 +0900 |
parents | 42ecbd9364fa |
children |
line wrap: on
line diff
--- a/build.gradle Wed Nov 28 17:34:23 2018 +0900 +++ b/build.gradle Wed Nov 28 18:28:39 2018 +0900 @@ -1,106 +1,37 @@ - -apply plugin:'java' - - -sourceCompatibility = 1.11 -targetCompatibility = 1.11 -version = '0.1.0' +plugins { + id 'java' +} -project.ext.baseName = 'wifibroadcast' - -defaultTasks 'clean', 'dist' +group 'FileWrite' +version '1.0-SNAPSHOT' - - - +sourceCompatibility = 11 -def manifestAttributes = ['Main-Class': 'jp.ac.uryukyu.ie.kono.wifibroadcast.WifiBroadcast', - 'Implementation-Version': "${project.version} (${buildNo})", - 'Implementation-Title': 'WifiBroadcast', - 'Implementation-Vendor': 'uryukyu'] +repositories { + mavenCentral() + jcenter() +} -jar { - baseName = project.baseName - version = null - manifest { - attributes manifestAttributes - } - def runtimeDeps = configurations.viewerSwingRuntime.collect { - it.isDirectory() ? it : zipTree(it) - } - from(runtimeDeps) { - exclude 'META-INF/**' +test { + useJUnitPlatform { + includeEngines 'junit-jupiter' } } - - - -task noSshJar (type: Jar, dependsOn: classes) { - baseName = 'nossh/' + project.baseName - version = null - manifest { - attributes manifestAttributes - } - from sourceSets.main.output -} - -artifacts { - archives file('src/web/viewer-applet-example.html') - archives noSshJar -} - -uploadArchives { - repositories { - - } - uploadDescriptor = false +dependencies { + testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.1.0' + testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.1.0' } -task dist(dependsOn: uploadArchives) - -def processBuildNo(currentVersion) { - final String VERSION = 'version' - final String BUILD = 'build' - - def lastVersion = currentVersion - def lastBuild = 0 - def buildNoFile = new File('.build_no') - if ( ! buildNoFile.exists()) { - buildNoFile.createNewFile() - buildNoFile << "${VERSION}=${lastVersion}\n${BUILD}=${lastBuild}" +compileJava { + options.compilerArgs << "-Werror" +} +jar { + from configurations.compile.collect { it.isDirectory() ? it :zipTree(it) } + manifest { + attributes "Main-Class":"jp.ac.uryukyu.ie.kono.wifibroadcast.WifiBroadcastTest" + attributes 'Implementation-Title':'Gradle Quickstart', 'Implementation-Version':version } - def versions = [:] - buildNoFile.eachLine { - def splitted = it.split('=') - if (splitted.size() == 2) { - def (key, value) = splitted - switch(key.trim()) { - case VERSION: - lastVersion = value.trim() - break - case BUILD: - try { - lastBuild = value != null ? value.trim() as Integer : 0 - } catch (NumberFormatException) {} - versions[lastVersion] = lastBuild - break - } - } - } - lastVersion = versions[currentVersion] - if (null == lastVersion) { - versions[currentVersion] = 0 - } - ++versions[currentVersion] - def outString = '' - versions.each { v, b -> - outString += "${VERSION}=${v}\n${BUILD}=${b}\n\n" - } - buildNoFile.write(outString) - versions[currentVersion] } -// set mainclass to Application Plugin -mainClassName = 'com.glavsoft.viewer.TreeViewer' -applicationName = 'TreeVNC' +defaultTasks 'test'