Ignore:
Timestamp:
2016-07-21T15:24:10+02:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Clean up build.gradle

The build file for Gradle is now split in several parts for a better overview and better maintainability.
The files gradle/*.gradle are parts that are unlikely to change often, because these are not specific to this plugin and can be configured through gradle.properties.
Also the Gradle version is bumped to 2.14.1, because a critical defect has been fixed since 2.14 (see https://docs.gradle.org/2.14.1/release-notes).

Location:
applications/editors/josm/plugins/mapillary
Files:
7 added
6 edited
2 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/.eclipse-pmd

    r32063 r32693  
    33  <analysis enabled="true" />
    44  <rulesets>
    5     <ruleset name="Ruleset for josm-mapillary-plugin" ref=".settings/pmd-ruleset.xml" refcontext="project" />
     5    <ruleset name="Ruleset for josm-mapillary-plugin" ref="config/pmd/ruleset.xml" refcontext="project" />
    66  </rulesets>
    77</eclipse-pmd>
  • applications/editors/josm/plugins/mapillary/.settings/launchers/Remote debug JOSM-Mapillary.launch

    r32381 r32693  
    1717  <mapAttribute key="org.eclipse.jdt.launching.CONNECT_MAP">
    1818    <mapEntry key="hostname" value="localhost"/>
    19     <mapEntry key="port" value="5006"/>
     19    <mapEntry key="port" value="7051"/>
    2020  </mapAttribute>
    2121  <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="JOSM-Mapillary"/>
  • applications/editors/josm/plugins/mapillary/build.gradle

    r32689 r32693  
    55apply plugin: 'java'
    66apply plugin: 'pmd'
     7
     8configurations {
     9  compile.extendsFrom(requiredPlugin)
     10}
     11
     12apply from: 'gradle/manifest.gradle'
     13apply from: 'gradle/josm-tasks.gradle'
     14apply from: 'gradle/tool-config.gradle'
    715
    816sourceCompatibility = '1.8'
     
    3947  compile(':josm:10583')
    4048  // For plugins it's irrelevant, which version is specified, always the latest version is used.
    41   compile (name: 'apache-commons'){changing=true}
    42   compile (name: 'apache-http'){changing=true}
     49  requiredPlugin (name: 'apache-commons'){changing=true}
     50  requiredPlugin (name: 'apache-http'){changing=true}
    4351
    4452  testCompile 'junit:junit:4.12'
     
    8290tasks.eclipse.dependsOn = ['eclipseClasspath', 'eclipseProject']
    8391
    84 pmd {
    85   toolVersion project.property('tools.pmd.version')
    86   ignoreFailures true
    87   targetJdk 1.7 // 1.8 is not yet available (as of Gradle 2.14, see https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/quality/TargetJdk.html)
    88   ruleSetConfig = resources.text.fromFile('.settings/pmd-ruleset.xml')
    89 }
    90 
    91 build.dependsOn jacocoTestReport
    92 
    9392tasks.withType(Javadoc) {
    9493  failOnError false
    95 }
    96 
    97 /** FindBugs configuration */
    98 findbugs {
    99   toolVersion = project.property('tools.findbugs.version')
    100   ignoreFailures = true
    101   effort = "max"
    102   reportLevel = "low"
    103 }
    104 tasks.withType(FindBugs) {
    105   reports {
    106     xml.enabled = false
    107     html.enabled = true
    108   }
    109 }
    110 
    111 /** JaCoCo configuration */
    112 jacoco {
    113   toolVersion = project.property('tools.jacoco.version')
    114 }
    115 jacocoTestReport {
    116   reports {
    117     xml.enabled true
    118     html.destination "$buildDir/reports/jacoco"
    119   }
    12094}
    12195
     
    126100  }
    127101}
    128 
    129 jar {
    130   manifest {
    131     attributes(
    132       "Gradle-Version": project.getGradle().getGradleVersion(),
    133       "Created-By": System.getProperty("java.version")+" ("+System.getProperty("java.vendor")+")",
    134       "Plugin-Mainversion": project.property('plugin.main.version'),
    135       "Plugin-Version": project.property('plugin.svnrevision'),
    136       "Plugin-SemVersion": project.property('plugin.version'),
    137       "Plugin-Class": project.property('plugin.class'),
    138       "Plugin-Description": project.property('plugin.description'),
    139       "Plugin-Date": String.format("%1\$tY-%1\$tm-%1\$tdT%1\$tH:%1\$tM:%1\$tS%1\$tz", new GregorianCalendar()),
    140       "Author": project.property('plugin.author'),
    141       "Plugin-Link": project.property('plugin.link'),
    142       "Plugin-Icon": project.property("plugin.icon"),
    143       "Plugin-Requires": project.property("plugin.requires"),
    144       "Plugin-Canloadatruntime": project.property('plugin.canloadatruntime')
    145     )
    146   }
    147 }
    148 
    149 task activatePlugin(type: Copy) {
    150   if (!new File("$buildDir/.josm/preferences.xml").exists()) {
    151     from "gradle/josm-preferences.xml"
    152     into "$buildDir/.josm"
    153     rename 'josm-preferences.xml', 'preferences.xml'
    154   }
    155 }
    156 
    157 task installPlugin(type: Copy) {
    158  from "$buildDir/libs/${project.name}.jar"
    159  from configurations.runtime
    160  into "$buildDir/.josm/plugins"
    161  include 'apache*.jar'
    162  include "${project.name}.jar"
    163  rename "${project.name}.jar", 'Mapillary.jar'
    164  rename 'apache-(.*)-.*.jar', 'apache-$1.jar'
    165 }
    166 installPlugin.dependsOn jar
    167 installPlugin.dependsOn activatePlugin
    168 
    169 /**
    170  * This runs the JOSM-version specified in the dependency configuration above.
    171  * The home-directory of this JOSM is located in $buildDir/.josm, so it doesn't interfere with any other JOSM-installations.
    172  */
    173 task runJosm(type: JavaExec) {
    174   classpath = sourceSets.main.runtimeClasspath
    175   main = 'JOSM'
    176   args '--offline=josm_website'
    177   jvmArgs "-Djosm.home=$buildDir/.josm"
    178 }
    179 runJosm.dependsOn installPlugin
    180 
    181 
    182 task debugJosm(type: JavaExec) {
    183   classpath = sourceSets.main.runtimeClasspath
    184   main = 'JOSM'
    185   args '--offline=josm_website'
    186   jvmArgs "-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006", "-Djosm.home=$buildDir/.josm"
    187 }
    188 debugJosm.dependsOn installPlugin
  • applications/editors/josm/plugins/mapillary/config/josm/preferences.xml

    r32690 r32693  
    66    <entry value='apache-http'/>
    77  </list>
     8  <tag key='pluginmanager.time-based-update.policy' value='never'/>
     9  <tag key='pluginmanager.version-based-update.policy' value='never'/>
    810</preferences>
  • applications/editors/josm/plugins/mapillary/gradle.properties

    r32680 r32693  
    77plugin.main.version=10580
    88plugin.requires=apache-commons;apache-http
    9 plugin.version=1.1.5
    109plugin.svnrevision=31976
    1110#plugin.early=...
    1211#plugin.stage=...
    1312
    14 tools.pmd.version=5.5.0
    15 tools.findbugs.version=3.0.1
    16 tools.jacoco.version=0.7.7.201606060606
     13# The name for the JAR file produced by Gradle (optional, defaults to ${project.name})
     14plugin.jar.name=Mapillary
     15
     16tool.pmd.version=5.5.0
     17tool.findbugs.version=3.0.1
     18tool.jacoco.version=0.7.7.201606060606
  • applications/editors/josm/plugins/mapillary/gradle/wrapper/gradle-wrapper.properties

    r32285 r32693  
    33zipStoreBase=GRADLE_USER_HOME
    44zipStorePath=wrapper/dists
    5 distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
    6 distributionSha256Sum=65bbc0ef9c48be86fb06522fc927d59dcc7c04266f2bb8156be76971f7c3fc4a
     5distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
     6distributionSha256Sum=88a910cdf2e03ebbb5fe90f7ecf534fc9ac22e12112dc9a2fee810c598a76091
Note: See TracChangeset for help on using the changeset viewer.