Skip to content

Commit

Permalink
ISSUE ysb33r#6. Quote key-value pairs for variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ysb33r committed Jul 14, 2016
1 parent 7822dd6 commit cb06be5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
= CHANGELOG

== Version 1.1 Roadmap
== Version 1.2 Roadmap

* https://github.com/ysb33r/gnumake-gradle-plugin/issues/6[#6] - Variables should be quoted under Windows.

== Version 1.1

* https://github.com/ysb33r/gnumake-gradle-plugin/issues/5[#5] - Gradle upgrade to v 2.12
* Upgradle plugin to be built by Gradle 2.14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.ysb33r.gradle.gnumake.internal

import org.gradle.api.Project
import org.gradle.internal.os.OperatingSystem
import org.gradle.process.ExecResult
import org.ysb33r.gradle.gnumake.GnuMakeBuild
import org.ysb33r.gradle.gnumake.GnuMakeExtension
Expand All @@ -23,6 +24,8 @@ import org.ysb33r.gradle.gnumake.GnuMakeExtension
* @author Schalk W. Cronjé
*/
class TaskUtils {
static final boolean IS_WINDOWS = OperatingSystem.current().isWindows()

static List<String> buildCmdArgs(Project project,GnuMakeBuild task,List<String> targets) {

List<String> execArgs = []
Expand All @@ -43,7 +46,9 @@ class TaskUtils {

def includes = (task.includeDirs.files.collectMany { ['-I', "${it.absolutePath}"] })

def flags = task.flags.collect { k, v -> "$k=$v" }
def flags = task.flags.collect { k, v ->
IS_WINDOWS ? "\"$k=$v\"": "$k=$v"
}

execArgs + switches + includes + targets + flags + task.switches
}
Expand Down

0 comments on commit cb06be5

Please sign in to comment.