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

task 'msbuild' fails when gradle-properties-plugin is used #53

Open
sergey-selivanov opened this issue Dec 3, 2015 · 5 comments
Open
Labels

Comments

@sergey-selivanov
Copy link

If to add gradle-properties-plugin to the build, msbuild task fails without clear reason:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':msbuild'.
> Trying to evaluate a GString containing a Closure taking 2 parameters

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':msbuild'.
   at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
...
   at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: groovy.lang.GroovyRuntimeException: Trying to evaluate a GString containing a Closure taking 2 parameters
   at org.gradle.process.internal.ExecHandleBuilder.getArgs(ExecHandleBuilder.java:90)
...
   at org.gradle.api.Project$exec$6.call(Unknown Source)
   at com.ullink.Msbuild.build(Msbuild.groovy:129)
   at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)

Gradle-properties-plugin is here: https://github.com/stevesaliman/gradle-properties-plugin
Full build log and build.gradle:

log.txt

build.gradle.txt

@gluck
Copy link
Contributor

gluck commented Dec 3, 2015

Hi,

do you mean the build works fine without Gradle-properties-plugin applied ?
It'd help if you were to provide a minimal build which fails, right now I can't see which GString/closure is failing.

Maybe check the properties you're injecting ? could be that one of them is conflicting with msbuild.

@sergey-selivanov
Copy link
Author

Hi gluck,

  1. yes, build perfectly works without gradle-properties-plugin. It is sufficient to simply add "apply plugin: 'net.saliman.properties'" line to get failure in msbuild.

  2. I will try to prepare minimal build but can't promise how soon. I'll use Visual Studio Community 2013, please tell if that matters.

  3. As I can judge, 5 my properties are injected by that plugin: artifactory_password, artifactory_contextUrl, artifactory_user, jna.nosys, rest.apiBaseUri, - seems not suspicious.

@sergey-selivanov
Copy link
Author

Here is the minimal build to reproduce the issue - rename attached file to .zip
Run 'gradle clean msbuild': runs OK
Uncomment line 12 in build.gradle, run 'gradle clean msbuild': exception.
Reproduces with gradle 2.9, 2.5.

test-gradle-plugins.zip.txt

@bluegod359
Copy link

Hi, did anyone work out what the issue was. I've just encountered this and I'm using saliman plugin for picking env property file and then trying to kick off msbuild.

@gluck
Copy link
Contributor

gluck commented Apr 26, 2016

Hi, saliman plugin seems to inject methods in each task ExtensionAware properties (task.ext["foo"] = closure), this messes up this plugin which assumes these properties are to be passed down to msbuild (cf README).

Not sure if this (a bit intrusive) behavior is intended. Maybe it can be workaround on this plugin side, but the logic to decide which properties are to be passed down to msbuild would be cranky (exclude closures ? include only strings, gstrings, numbers ?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants