Skip to content

Commit

Permalink
copyLauncherBinaries overwrites existing files (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
uschi2000 authored Jul 7, 2016
1 parent ef829c3 commit 37a2be6
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
*/
package com.palantir.gradle.javadist

import java.nio.file.Files
import java.nio.file.Paths

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task

import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption

class JavaDistributionPlugin implements Plugin<Project> {

private static final String GROUP_NAME = "Distribution"
Expand Down Expand Up @@ -67,7 +68,8 @@ class JavaDistributionPlugin implements Plugin<Project> {
["javalauncher-linux-amd64", "javalauncher-darwin-amd64"].each { file ->
def dest = Paths.get("${project.buildDir}/scripts/${file}")
dest.parent.toFile().mkdirs()
Files.copy(JavaDistributionPlugin.class.getResourceAsStream("/${file}"), dest)
Files.copy(JavaDistributionPlugin.class.getResourceAsStream("/${file}"),
dest, StandardCopyOption.REPLACE_EXISTING)
dest.toFile().setExecutable(true)
}
}
Expand Down

0 comments on commit 37a2be6

Please sign in to comment.