Mercurial > hg > Applications > TreeVNC
view build.gradle @ 587:b2bcfcfbfc1c
fix
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 12 Feb 2020 17:18:24 +0900 |
parents | 52da5806661c |
children | 320392910cb8 |
line wrap: on
line source
plugins { id 'application' } apply plugin:'java' apply plugin: 'eclipse' apply plugin: 'application' sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 version = '2.7.2' project.ext.baseName = 'tightvnc-jviewer' def buildNo = processBuildNo(version) defaultTasks 'clean' , 'jar' //application { // mainClassName = "com.glavsoft.viewer.TreeViewer"// // } configurations { viewerSwingImplementation { extendsFrom implementation } } 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 { flatDir { dirs 'src/libs/' } } dependencies { viewerSwingImplementation group: 'com.jcraft', name: 'jsch', version: '0.1.+', ext: 'jar' implementation group: 'com.jcraft', name: 'jsch', version: '0.1.+', ext: 'jar' } def manifestAttributes = ['Main-Class': 'com.glavsoft.viewer.TreeViewer', 'Implementation-Version': "${project.version} (${buildNo})", 'Implementation-Title': 'TightVNC Viewer', 'Implementation-Vendor': 'GlavSoft LLC.'] jar { manifest { attributes manifestAttributes } } task noSshJar (type: Jar, dependsOn: classes) { manifest { attributes manifestAttributes } from sourceSets.main.output } 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}" } 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'