Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ProcessBuilder to launch 'chmod' #28

Merged
merged 1 commit into from
Sep 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public void execute() throws MojoExecutionException {
}

File workdir = setupBuildEnvironment();

Config c = new Config();

c.setHeaderType(headerType);
Expand Down Expand Up @@ -451,10 +451,9 @@ private File unpackWorkDir(Artifact a) throws MojoExecutionException {
*/
private void setPermissions(File workdir) {
if (!System.getProperty("os.name").startsWith("Windows")) {
Runtime r = Runtime.getRuntime();
try {
r.exec("chmod 755 " + workdir + "/bin/ld").waitFor();
r.exec("chmod 755 " + workdir + "/bin/windres").waitFor();
new ProcessBuilder("chmod", "755", workdir + "/bin/ld").start().waitFor();
new ProcessBuilder("chmod", "755", workdir + "/bin/windres").start().waitFor();
} catch (InterruptedException e) {
getLog().warn("Interrupted while chmodding platform-specific binaries", e);
} catch (IOException e) {
Expand All @@ -468,7 +467,7 @@ private void setPermissions(File workdir) {
*/
private List<String> relativizeAndCopy(File workdir, List<String> paths) throws MojoExecutionException {
if(paths == null) return null;

List<String> result = new ArrayList<>();
for(String path : paths) {
Path source = basedir.toPath().resolve(path);
Expand All @@ -492,7 +491,7 @@ private List<String> relativizeAndCopy(File workdir, List<String> paths) throws

return result;
}

/**
* Downloads the platform-specific parts, if necessary.
*/
Expand Down