Ignore:
Timestamp:
2016-09-20T23:37:16+02:00 (8 years ago)
Author:
floscher
Message:

[mapillary] Fix Gradle task initJosmPrefs when run together with cleanJosm

Previously the decision if 'initJosmPrefs' should actually copy the preferences or do nothing was made in the initialization phase of Gradle.
Otherwise if e.g. 'cleanJosm' also runs, it's decided in the init-phase that the preferences are not copied, because there already is a preference file. But that file is deleted, when 'cleanJosm' is executed. When 'initJosmPrefs' is then executed, that file would not be restored, because the decision not to copy already has been made.

Because of that, this decision is now made in the execution phase.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/gradle/josm-tasks.gradle

    r32693 r32999  
    1212 */
    1313task initJosmPrefs(type: Copy) {
    14   if (!new File("$buildDir/.josm/preferences.xml").exists()) {
    15     from "config/josm/preferences.xml"
    16     into "$buildDir/.josm"
     14  doFirst {
     15    if (new File("$buildDir/.josm/preferences.xml").exists()) {
     16      println "JOSM preferences not copied, file is already present.\nIf you want to replace it, run the task 'cleanJosm' additionally."
     17      exclude '*'
     18    }
    1719  }
     20  from "config/josm/preferences.xml"
     21  into "$buildDir/.josm"
    1822}
    1923
Note: See TracChangeset for help on using the changeset viewer.