itiviti / gradle-msbuild-plugin Goto Github PK
View Code? Open in Web Editor NEWGradle plugin for msbuild execution, supports C# project files for now
License: Apache License 2.0
Gradle plugin for msbuild execution, supports C# project files for now
License: Apache License 2.0
Hello!
I'm trying to work the first time with the msbuild plugin and I can't even get a simple buildscript running.
My build.gradle:
apply plugin:'msbuild'
buildscript {
repositories {
maven {
url "http://artifacts/repos"
}
}
dependencies {
classpath 'com.ullink.gradle:gradle-msbuild-plugin:1.+'
}
}
msbuild {
solutionFile = 'ConsoleApplication1.sln'
configuration = 'Debug'
projectName = 'ConsoleApplication1'
}
It is downloading all dependencies, but I get the following error:
A problem occured evaluating root project 'ConsoleApplication1'.
Could not create task of type 'Msbuild'.
And the stacktrace at the end:
Caused by: java.lang.NoClassDefFoundError: com/sun/jna/PointerType
Caused by: java.lang.ClassNotFoundException: com.sun.jna.PointerType
Gradle however downloaded the net.java.dev.jna:jna:3.5.0 before the build, so I don't know how to get it working.
Thanks!
I have a build that involves two csproj files and one wixproj (to build the installer). In the build.gradle, the two csproj projects are defined first, and then the wixproj configuration is added. But when I try running the build, it tries building the installer first. This fails, of course, because none of the files it is looking for have been built.
Is there a way to force the projects to build in a specified order?
Thanks.
At the moment it seems, that one must add a single configuration to the msbuild configuration block.
What I need is a task, which builds my visual studio solution with both configurations 'Release' and 'Debug', so that I can upload both artifacts to maven with one gradle call.
Therefore, I ask for a possibility to define multiple configurations in the msbuild configuration. e.g.:
msbuild {
...
targets = ['Clean', 'Rebuild']
configurations = ['Release', 'Debug']
}
I already tried to call msbuild mutliple times, but the latter did unforunately not work, as the task 'msbuild' is only executed once (in the example, gradle clean build
builds only the msbuild with configuration Release):
task buildRelease() << {
msbuild.configuration = 'Release'
tasks["msbuild"].execute()
}
task buildDebug() << {
msbuild.configuration = 'Debug'
tasks["msbuild"].execute()
}
tasks["msbuild"].outputs.upToDateWhen { false }
tasks["build"].dependsOn buildDebug
tasks["build"].dependsOn buildRelease
buildDebug.dependsOn buildRelease
Plugin is unable to find msbuild v15+ on computer with:
In this case plugin finds MSBuild v14 only (e.g. it will unable to build short new csproj projects)
In VS 2017 has been changed way to register tools in the system and now each VS installation creates a file in %ProgramData%\Microsoft\VisualStudio\Packages\_Instances\%installation_id%\state.json
.
In the installationPath
we can retrieve a VS installation path and check MsBuild availability in the MSBuild
directory.
I am getting this error when I try to specify the 'intermediateDir' for a 'msbuild' task:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(618,5): error : The IntermediateOutputPath must end with a trailing slash.
I was able to get a fix working locally. I can send a patch if you like, but essentially all that really needed to be done was add the slash. My patch has a few other small tweaks as well if you're interested.
If I don't redefine destinationDir
to be under ${buildDir}
then Gradle clean would not clean msbuild
output
After the msbuild process ends (verified in task manager), the gradle process continues to hang. Windows 7, VS 2013 or 2015, Java 8, Gradle 3.0 or 3.2. No issues on Linux.
This is effectively a blocker for any nontrivial build.
Attaching jstack output.
Looks similar to a complaint about gradle here: https://discuss.gradle.org/t/weirdness-in-gradle-exec-on-windows/13660/6
Hello,
Firstly, thanks for this msbuild plugin.
I have an error when trying to launch my build file. Here it is :
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.ullink.gradle:gradle-msbuild-plugin:1.7" //or 1.6, same problem
}
}
apply plugin:'msbuild'
msbuild {
// mandatory
projectFile = 'MyProject.csproj'
// Verbosity (/v:detailed, by default uses gradle logging level)
verbosity = 'quiet'
configuration = 'Release'
platform = 'Windows Phone'
}
My project is a Windows Phone project. I get the following error : Could not determine the dependencies of task ':msbuild'. With the stack traces activated, I get another information :
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.io.FileNotFoundException: C:\Program Files\MSBuild\Microsoft\Silverlight for Phone\v4.0\Microsoft.Silverlight.WindowsPhone71.Overrides.targets (Le chemin d'accès spécifié est introuvable).
Indeed, this file does not exist, but it does exist in C:\Program Files (x86).... (same path after). Is this a bug ? Could I configure the path myself ?
Thanks for your help and support !
With the new version 2.19 of the plugin on our build system we receive:
:msbuild FAILED
Task: :msbuild took 1843ms
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':msbuild'.
> java.io.FileNotFoundException: C:\jenkins\workspace\Build-PDFC-ProcessBridge-NET\PDFCProcessBridge.NET\Visual Studio Locator version 2.3.7+gfb01ddad81
Copyright (C) Microsoft Corporation. All rights reserved.
Error 0x57: The "version" parameter is not supported\MSBuild
.....
Caused by: java.io.FileNotFoundException: C:\jenkins\workspace\Build-PDFC-ProcessBridge-NET\PDFCProcessBridge.NET\Visual Studio Locator version 2.3.7+gfb01ddad81
Copyright (C) Microsoft Corporation. All rights reserved.
Error 0x57: The "version" parameter is not supported\MSBuild
at com.ullink.MsbuildResolver.findMsbuildByVsWhere(MsbuildResolver.groovy:36)
at com.ullink.MsbuildResolver$findMsbuildByVsWhere.callStatic(Unknown Source)
at com.ullink.MsbuildResolver.setupExecutable(MsbuildResolver.groovy:62)
at com.ullink.IExecutableResolver$setupExecutable$0.call(Unknown Source)
at com.ullink.Msbuild.getCommandLineArgs(Msbuild.groovy:156)
at com.ullink.Msbuild_Decorated.getCommandLineArgs(Unknown Source)
at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:479)
at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191)
at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.java:98)
at org.gradle.internal.metaobject.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:30)
at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:80)
at com.ullink.Msbuild$_build_closure7.doCall(Msbuild.groovy:151)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:71)
at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:160)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:106)
at org.gradle.util.ConfigureUtil$1.execute(ConfigureUtil.java:123)
at org.gradle.api.internal.file.DefaultFileOperations.exec(DefaultFileOperations.java:187)
at org.gradle.api.internal.project.DefaultProject.exec(DefaultProject.java:1076)
at org.gradle.api.internal.project.DefaultProject.exec(DefaultProject.java:1071)
at org.gradle.api.Project$exec$4.call(Unknown Source)
at com.ullink.Msbuild.build(Msbuild.groovy:150)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
... 41 more
I think I've stumbled upon a resolution error with the XBuildResolver
code. I have Mono installed on OSX via Homebrew:
$ brew info mono
mono: stable 4.2.0.179 (bottled)
Cross platform, open source .NET development framework
http://www.mono-project.com/
/usr/local/Cellar/mono/4.2.0.179 (1010 files, 184M) *
Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/mono.rb
==> Caveats
To use the assemblies from other formulae you need to set:
export MONO_GAC_PREFIX="/usr/local"
If I use which
I can see:
$ which xbuild
/usr/local/bin/xbuild
xbuild
is a "POSIX shell script text executable". The file itself looks like:
#!/bin/sh
exec /usr/local/Cellar/mono/4.2.0.179/bin/mono $MONO_OPTIONS /usr/local/Cellar/mono/4.2.0.179/lib/mono/xbuild/12.0/bin/xbuild.exe "$@"
At the moment with my simple test project I get the following output when run with --info
level:
$ gradle msbuild --info
Starting Build
Settings evaluated using settings file '/master/settings.gradle'.
Projects loaded. Root project using build file '/Users/novabyte/Projects/TestMSBuild/build.gradle'.
Included projects: [root project 'TestMSBuild']
Evaluating root project 'TestMSBuild' using build file '/Users/novabyte/Projects/TestMSBuild/build.gradle'.
All projects evaluated.
Selected primary task 'msbuild' from project :
Tasks to be executed: [task ':msbuild']
:msbuild (Thread[main,5,main]) started.
:msbuild
Executing task ':msbuild' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
Resolved xbuild to: /usr/local/lib/mono/xbuild/14.0/bin/xbuild.exe
Starting process 'command '/usr/local/lib/mono/xbuild/14.0/bin/xbuild.exe''. Working directory: /Users/novabyte/Projects/TestMSBuild Command: /usr/local/lib/mono/xbuild/14.0/bin/xbuild.exe /nologo /Users/novabyte/Projects/TestMSBuild/TestMSBuild.csproj /t:Build /v:normal /p:Project=TestMSBuild /p:IntermediateOutputPath=/Users/novabyte/Projects/TestMSBuild/build/msbuild/obj\ /p:OutputPath=/Users/novabyte/Projects/TestMSBuild/build/msbuild/bin\
Successfully started process 'command '/usr/local/lib/mono/xbuild/14.0/bin/xbuild.exe''
/usr/local/lib/mono/xbuild/14.0/bin/xbuild.exe: /usr/local/lib/mono/xbuild/14.0/bin/xbuild.exe: cannot execute binary file
:msbuild FAILED
:msbuild (Thread[main,5,main]) completed. Took 0.278 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':msbuild'.
> Process 'command '/usr/local/lib/mono/xbuild/14.0/bin/xbuild.exe'' finished with non-zero exit value 126
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 3.7 secs
I believe the problem is that the plugin is trying to invoke xbuild.exe
directly on OSX which does not work without being called by the Mono runtime. I think the plugin should use the xbuild
POSIX script to execute a build.
When I set 'destinationDir' and run "gradle msbuild", I get the following error.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':msbuild'.
> The filename, directory name, or volume label syntax is incorrect
I'm using the version 1.9.
When I remove it, it succeeds.
My environment is
When using the getProjects()
method in Msbuild
, there's a warning that a certain project doesn't exist "Project ${projectName} not found in solution". The constructor of Msbuild
seems to be making the assumption that there is both a project and solution file with a name that matches whatever project.name
resolves to but this isn't a standard convention with solution; the warning seems to be out of place.
Hi,
I'm trying to use this plugin to build a C#/.NET project, originally created in VS2017 using the
'gradle clean msbuild' command. I am using a Mac.
Here is my build.gradle file:
`plugins {
id 'com.ullink.msbuild' version '2.19'
}
msbuild {
solutionFile = 'csharp/Basic/Producer/DEBProducer/DEBProducer.csproj'
targets = ['Clean','Rebuild']
}
`
Here is my gradle version
`gradle --version
Build time: 2018-06-21 07:53:06 UTC
Revision: 0abdea078047b12df42e7750ccba34d69b516a22
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_131 (Oracle Corporation 25.131-b11)
OS: Mac OS X 10.13.6 x86_64`
This is my msbuild version:
msbuild -version Microsoft (R) Build Engine version 15.6.0.0 (xplat-master/ca830585 Sun Mar 25 19:24:09 EDT 2018) for Mono Copyright (C) Microsoft Corporation. All rights reserved.
Originally I was getting this error:
The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.
After adding the line the project element in my .csproj i received the following error:
The attribute "Version" in element <PackageReference> is unrecognized.
After a good amount of googling, every solution to this error I've come across is to upgrade from VS2015 to VS2017, however VS2017 is the Visual Studio version I am using. It appears to me that it may be using an older version of msbuild (I could be wrong), is it possible set the required version of ms build?
Thank you for your help!
I want to create my dll-files in a folder of my choice, but even if I define destinationDir, they are always created in the default folder
My task looks as follows:
task createReleaseDllForWin32(type: Msbuild){
onlyIf{ OperatingSystem.current().windows }
solutionFile = "path/to/solutionfile.sln"
configuration = 'Release'
platform = "Win32"
targets = ['Clean','Build']
destinationDir = "build/msbuild/bin"
}
While parsing my solution:
Parsing file whatever.sln ...
Error during project file parsing: Microsoft.Build.BuildEngine.InvalidProjectFileException: The attribute "Label" in element <Import> is unrecognized. c:\foo\bar.csproj
The csproj
file contains:
<Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')" Label="SlowCheetah" />
With the offending attribute.
IMHO, the parser should ignore any non-known attribute.
When the Project tag has ToolsVersion="12.0", I'm getting the "Could not determine the dependencies of task" error, with this down in the stack trace:
Caused by: java.io.FileNotFoundException: C:\Program Files (x86)\MSBuild\12.0\Bin\amd64 (Access is denied)
Switching ToolsVersion to 4.0 fixes the problem, but we'll eventually want to use MSBuild version 12.0. Has there been any investigation of this issue yet? It seems like it might be as easy as adding one number to the list of possible tools versions, but things are rarely as easy as they seem.
Thanks.
Gradle fails to start when the projects
property in assemblyInfoPatcher
section of build.graddle is set to non empty array of strings. I tried to trace a problem and found that it appears at AssemblyInfoVersionPatcher (31:66), but I have no idea how to fix it.
Here is a gradle stacktrace
atm 2.11 from october 2015 is the latest release on central
I'd like to use the new informationalVersion feature which was added in november
please consider releasing a new version to central
Hello! How i can build winPhone project with your gradle plugin for msbuild?
Any plans to support C++ builds on windows?
Just wanted to know if this was possible to do this?
I have one project in C++.
Output Directory set to
Intermediate Directory to $(Configuration)\
Still i am getting warning in MSbuild log
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(345,5): warning MSB8004: Intermediate Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Intermediate Directory.
I'm getting this exception:
16:57:34.499 [DEBUG] [org.gradle.api.Project] Msbuild plugin detected. Will add defaults from it. 16:57:34.500 [INFO] [org.gradle.api.Task] Parsing file my_lib.sln ... 16:57:35.031 [ERROR] [org.gradle.api.Task] Error during project file parsing: System.InvalidCastException: Unable to cast object of type 'System.Xml.XmlComment' to type 'System.Xml.XmlElement'. 16:57:35.031 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.ProcessProjectChildren(XmlElement projectElement, String projectDirectoryLocation, Boolean importedProject) 16:57:35.031 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.ProcessImportElement(XmlElement importElement, String projectDirectoryLocation, Boolean importedProject) 16:57:35.032 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.ProcessProjectChildren(XmlElement projectElement, String projectDirectoryLocation, Boolean importedProject) 16:57:35.032 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.ProcessMainProjectElement() 16:57:35.032 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.InternalLoadFromXmlDocument(XmlDocument projectXml, ProjectLoadSettings projectLoadSettings) 16:57:35.032 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.Load(String projectFileName, BuildEventContext buildEventContext, ProjectLoadSettings projectLoadSettings) 16:57:35.032 [ERROR] [org.gradle.api.Task] at ProjectFileParser.PlatformProjectHelper.Load(Project project, String file) 16:57:35.032 [ERROR] [org.gradle.api.Task] at ProjectFileParser.platform_helpers.MsbuildPlatform.Load(Project project, String file) 16:57:35.033 [ERROR] [org.gradle.api.Task] at ProjectFileParser.Program.Parse(String file) 16:57:35.033 [ERROR] [org.gradle.api.Task] at ProjectFileParser.Program.Main(String[] args) 16:57:35.033 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.ProcessProjectChildren(XmlElement projectElement, String projectDirectoryLocation, Boolean importedProject) 16:57:35.033 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.ProcessImportElement(XmlElement importElement, String projectDirectoryLocation, Boolean importedProject) 16:57:35.033 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.ProcessProjectChildren(XmlElement projectElement, String projectDirectoryLocation, Boolean importedProject) 16:57:35.034 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.ProcessMainProjectElement() 16:57:35.034 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.InternalLoadFromXmlDocument(XmlDocument projectXml, ProjectLoadSettings projectLoadSettings) 16:57:35.034 [ERROR] [org.gradle.api.Task] at Microsoft.Build.BuildEngine.Project.Load(String projectFileName, BuildEventContext buildEventContext, ProjectLoadSettings projectLoadSettings) 16:57:35.034 [ERROR] [org.gradle.api.Task] at ProjectFileParser.PlatformProjectHelper.Load(Project project, String file) 16:57:35.034 [ERROR] [org.gradle.api.Task] at ProjectFileParser.platform_helpers.MsbuildPlatform.Load(Project project, String file) 16:57:35.034 [ERROR] [org.gradle.api.Task] at ProjectFileParser.Program.Parse(String file) 16:57:35.035 [ERROR] [org.gradle.api.Task] at ProjectFileParser.Program.Main(String[] args) 16:57:35.037 [ERROR] [org.gradle.BuildExceptionReporter] 16:57:35.037 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 16:57:35.037 [ERROR] [org.gradle.BuildExceptionReporter] 16:57:35.037 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 16:57:35.038 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring root project 'my_lib'. 16:57:35.038 [ERROR] [org.gradle.BuildExceptionReporter] > Project file parsing failed
This is my gradle plugin setup:
plugins { id "com.ullink.nuget" version "2.13" id "com.ullink.msbuild" version "2.11" id 'at.bxm.svntools' version "1.3" id 'nu.studer.credentials' version "1.0.1" }
the C# solution is visual studio 2015 update 1
I would like to know how to manage third party dependencies such as log4net with plugin.
I'm getting the following error when doing:
.../gradle-msbuild-plugin-master>gradle
Where:
Script 'https://raw.github.com/gluck/gradle-scripts/master/gradle-plugin-base.gradle' line: 22
What went wrong:
A problem occurred evaluating script.
Could not find method groovy() for arguments [org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency_De
corated@433edba9] on root project 'gradle-msbuild-plugin-master'.
I tried it on two different OSes:
Hello,
I am using Windows 7 and gradle is not able to execute ProjectFileParser.exe from the users's temp directory (C:\Users\XXX\AppData\Local\Temp).
After a search on google, it seems that the problem comes from the security permission on the temp folder. The user should take ownership and full control of the temp folder.
Anyway, I think that it would be great to add a property (parserTempDir) to the MsBuild task. If this property is null we save the ProjectFileParser.exe in the user temp dir otherwise we save the file in the parserTempDir. So we can do something like that in Gradle:
msbuild {
parserTempDir = temporaryDir
...
}
With this, the ProjectFileParser will be saved in the build/tmp/msbuild directory.
Under Msbuild.groovy we have the code
['OutDir', 'OutputPath', 'BaseIntermediateOutputPath', 'IntermediateOutputPath', 'PublishDir'].each {
if (cmdParameters[it] && !cmdParameters[it].endsWith('\\')) {
cmdParameters[it] += '\\'
}
}
which doesn't look right on a Unix environment.
I have a case similar to the documented help:
// overrides project OutputPath
destinationDir = 'build/msbuild/bin'
// overrides project IntermediaryOutputPath
intermediateDir = 'build/msbuild/obj'
These paths will be modified to contain a '' in the end, causing the output to be copied to the wrong directory with the wrong name, e.g. (file 'bin\some_lib.dll' will be placed under build/ instead of build/bin/some_lib.dll)
I modified the sample buildscript on your home page and at the bottom there is the following code:
assemblyInfoPatcher {
...
projects = [ 'XZYProject' ]
}
When I looked at 'class AssemblyInfoVersionPatcher', 'fileVersion' and 'version' have a '@input' but not the 'projects'. Could this be the reason? Or am I doing something wrong?
My project's release process needs to update both the app and deploy manifests and signing some executables. It would be nice if I had support to mage.exe and signtool.exe on this plugin.
I have this error when the build is configuring. If I specify a solution file it works fine and if I specifify a project file and remove the task assemblyInfoPatcher it works fine.
The solution contains several projects.
The project and solution are attached: project_and_solution.zip
msbuild { //dependsOn << assemblyInfoPatcher //solutionFile = 'src/main/cs/' + project.name + '.sln' //projectName = project.name projectFile = 'src/main/cs/' + project.name + '.csproj' targets = ['Clean', 'Rebuild'] configuration = 'Release' platform = 'Any CPU' destinationDir = "$buildDir/bin" intermediateDir = "$buildDir/msbuild/obj" generateDoc = true verbosity = 'quiet' } assemblyInfoPatcher { version = project.version - '-SNAPSHOT' fileVersion = project.version }
The error (triggered by com.ullink.AssemblyInfoVersionPatcher$_closure5.doCall
) :
FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'Omega.Core'. > Cannot get property 'MSBuildProjectName' on null object * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'Omega.Core'. at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:74) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:532) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:93) at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35) at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125) at org.gradle.internal.Factories$1.create(Factories.java:22) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122) at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45) at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51) at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:33) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: java.lang.NullPointerException: Cannot get property 'MSBuildProjectName' on null object at com.ullink.ProjectFileParser.getProjectName(ProjectFileParser.groovy:22) at com.ullink.Msbuild.resolveProject(Msbuild.groovy:137) at com.ullink.Msbuild.getProjects(Msbuild.groovy:69) at com.ullink.Msbuild_Decorated.getProjects(Unknown Source) at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:166) at org.gradle.api.internal.BeanDynamicObject.getProperty(BeanDynamicObject.java:109) at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:81) at com.ullink.Msbuild_Decorated.getProperty(Unknown Source) at com.ullink.AssemblyInfoVersionPatcher$_closure5_closure10.doCall(AssemblyInfoVersionPatcher.groovy:30) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:110) at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:488) at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:58) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59) at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:202) at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:110) at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:115) at org.gradle.api.internal.tasks.RealizableTaskCollection.all(RealizableTaskCollection.java:187) at org.gradle.api.internal.DefaultDomainObjectCollection.withType(DefaultDomainObjectCollection.java:126) at org.gradle.api.DomainObjectCollection$withType.call(Unknown Source) at com.ullink.AssemblyInfoVersionPatcher$_closure5.doCall(AssemblyInfoVersionPatcher.groovy:29) at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40) at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25) at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy13.afterEvaluate(Unknown Source) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
I have a project with the NUnit unit tests in a subdirectory (UnitTests). I am trying to create a multiproject build where the root solution gets built first and the UnitTest solution gets built and run second. I tried creating a settings.gradle with a single "include 'UnitTests'" and then adding the following to the root build.gradle:
evaluationDependsOn(':UnitTests')
allprojects{
id 'com.ullink.msbuild' version '2.9'
}
apply plugin:'msbuild'
msbuild {
...
}
In my UnitTests build.gradle I have the following:
plugins {
id 'com.ullink.nunit' version '1.0'
}
dependencies {
compile project(':')
}
apply plugin:'msbuild'
msbuild {
...
}
The problem is the dependencies in the UnitTests gradle file. This gives me the error:
Could not find method compile() for arguments [root project 'QCoreTest'] on project ':UnitTests'.
I tried using 'msbuild' and 'build' (just trying anything really) but nothing works. How do I get the unit test project to build after the root project?
Mark
I have a source tree like so, where the solution file defines the paths to its constituent projects:
<root>
+---rootProject.sln
+---src
|
+---project-a
| +---project-a.csproj
+---project-b
+---project-b.csproj
This minimal configuration appears to successfully build every project in the solution:
msbuild {
solutionFile = 'rootProject.sln'
targets = ['Clean', 'Rebuild']
configuration = 'Release' // this should be included in the Readme
}
And, I was hoping that setting the assembly versions for all of the projects would be as simple as:
assemblyInfoPatcher {
version = project.version + '.0'
fileVersion = version + '.' + buildNumber
projects = 'project-a', 'project-b'
}
...but no matter what I configure for the patcher, even if I omit the projects
configuration, the patcher always complains:
Project project-a not found in solution
So, it appears that the patcher is not expecting or using the path information that is specified in the project entries for the solution file.
Is there a known issue on osx where it fails to create the a task?
What went wrong:
A problem occurred evaluating root project 'TxtToCsAndCpp'.
Failed to apply plugin [id 'msbuild']
Could not create task of type 'Msbuild'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Full stacktrace:
Plugin uses gradle 4.2, which fails on computers with Java 9.0.1 only installed.
How to reproduce:
Error:
C:\git\gradle-msbuild-plugin [master ≡]> .\gradlew.bat build
Downloading https://services.gradle.org/distributions/gradle-4.2-bin.zip
...................................................................
Unzipping C:\g\wrapper\dists\gradle-4.2-bin\cl9xe1l8k8ophj72k8rv6xbu7\gradle-4.2-bin.zip to C:\g\wrapper\dists\gradle-4.2-bin\cl9xe1l8k8ophj72k8rv6xbu7
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '9.0.1'.
Is the source code for these two executables available?
Hi!
The current Mono system complains about the usage of xbuild due to deprecation. It also don't support all parameters that are supported by msbuild. Msbuild is the new recommended build tool for Mono.
Pls. consider defaulting to msbuild instead of xbuild on Linux and MacOS.
BTW, I need this feature so I'm willing to help if you give me some starting point.
On my OSX system (El Capitan), I have the following framework versions in my Mono 4.4.0 installation:
/Library/Frameworks/Mono.framework/Versions/4.4.0/lib/mono:
2.0-api
3.5-api
4.0
4.0-api
4.5
4.5-api
Note the "-api" suffix on several of the versions. I am not entirely sure what they are for, but they seem to be normal for Mono 4.4.0. XBuildResolver fails to handle these suffixes correctly and throws an exception. The problem is that XBuildResolver initially uses the undocumented Groovy class VersionNumber to filter the list of directories under /lib/mono; it then assumes that it can parse any of the matching directory names as Floats. However VersionNumber allows a "-qualifier" to be appended to the version, which matches the "-api" in the directories above; but the "-api" cannot be parsed as a Float, causing the exception.
Currently, using 2.9, the msbuild plugin fails with the following, only on 32-bit windows:
:msbuild FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':msbuild'.
> Cannot invoke method sort() on null object
This comes from missing safe navigation in MsbuildResolver.groovy:38. That was easy enough to fix.
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:
Here's the detail on what you need to do - http://plugins.gradle.org/submit.
Using https://github.com/etiennestuder/gradle-plugindev-plugin by @etiennestuder will make your life significantly easier in this regards.
I
f you need help, just shout out.
Hello, I am trying to use this plugin to automate builds with Jenkins on a debian server. I can build the project fine from the command line using the xbuild command, however when I try to use this gradle plugin to automate things it throws an exception. Does anyone have any idea why I am getting this error, and what steps I could take to fix it?
> Configure project :
Error during project file parsing: System.TypeInitializationException: The type initializer for 'Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer' threw an exception. ---> System.EntryPointNotFoundException: GetSystemInfo
at (wrapper managed-to-native) Microsoft.Build.Shared.NativeMethodsShared:GetSystemInfo (Microsoft.Build.Shared.NativeMethodsShared/SYSTEM_INFO&)
at Microsoft.Build.Shared.NativeMethodsShared+SystemInformationData..ctor () [0x00023] in <f5a454bed8554c01935324e6d7db5f08>:0
at Microsoft.Build.Shared.NativeMethodsShared.get_SystemInformation () [0x0001e] in <f5a454bed8554c01935324e6d7db5f08>:0
at Microsoft.Build.Shared.NativeMethodsShared.get_ProcessorArchitecture () [0x00000] in <f5a454bed8554c01935324e6d7db5f08>:0
at Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer..cctor () [0x00010] in <f5a454bed8554c01935324e6d7db5f08>:0
--- End of inner exception stack trace ---
at Microsoft.Build.Collections.PropertyDictionary`1[T]..ctor (System.Int32 capacity) [0x00006] in <f5a454bed8554c01935324e6d7db5f08>:0
at Microsoft.Build.Evaluation.ProjectCollection..ctor (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.Collections.Generic.IEnumerable`1[T]
Debian: 9
Mono: 4.6.2
Gradle: 4.9
gradle-msbuild-plugin: 2.21
Hi,
I'm trying to build a very simple project with the sample build file provided.
Could not find method assemblyInfoPatcher() for arguments [build_6ayt6vpk7zunfhrs63upg3ynr$_run_closure2@59e2a4]
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.ullink.gradle:gradle-msbuild-plugin:2.1"
}
}
apply plugin:'msbuild'
msbuild {
// mandatory (one of those)
solutionFile = 'SampleProj.sln'
// MsBuild project name (/p:Project=...)
projectName = project.name
// Verbosity (/v:detailed, by default uses gradle logging level)
verbosity = 'detailed'
// targets to execute (/t:Clean;Rebuild, no default)
targets = ['Clean', 'Rebuild']
// Below values can override settings from the project file
// overrides project OutputPath
destinationDir = 'build/msbuild/bin'
// overrides project IntermediaryOutputPath
intermediateDir = 'build/msbuild/obj'
// Generates XML documentation file (from javadoc through custom DocLet)
generateDoc = false
// Other msbuild options can be set:
// loggerAssembly, generateDoc, debugType, optimize, debugSymbols, configuration, platform, defineConstants ...
// you can also provide properties by name (/p:SomeProperty=Value)
parameters.SomeProperty = 'Value'
// Or, if you use built-in msbuild parameters that aren't directly available here,
// you can take advantage of the ExtensionAware interface
ext["flp1"] = "LogFile=" + file("${project.name}.errors.log").path + ";ErrorsOnly;Verbosity=diag"
}
assemblyInfoPatcher {
// mandatory if you want to patch your AssemblyInfo.cs/fs
// TODO: not yet normalized, beware than .Net version must be X.Y.Z.B format, with Z/B optionals
version = project.version + '.0.0'
// defaults to above version, fewer restrictions on the format
fileVersion = version + '-Beta'
}
What could I be missing?
Thanks in advance!
Hello,
I am using this plugin to build a Visual Studio C++ solution. This solution contains around 15 projects (vcxproj). I want to compile the whole solution so I set the "projectFile" and ignore the "projectName".
When I run gradle (no matter of the task to execute), I receive the warning message:
Project XXX found in solution, disabling input/output optimizations
First, there is a mistake in the message: it should be "Project XXX not found ..." because the code in the resolveProject method of Msbuild.groovy:
projectParsed = allProjects[getProjectName()]
if (projectParsed == null) {
parseProject = false
logger.warn "Project ${getProjectName()} found in solution, disabling input/output optimizations"
}
As you can see, the warning is displayed only if the projectName project is not found.
Secondly, msbuild supports the "incremental" build so there is no need of gradle optimisation. So I just would like to disable this warning in the case of a whole solution build. I think that if projectName is not defined (null or empty string) then there is no need to display the warning.
Thanks.
After upgrading Visual Studio to version 2017 I receive the follow error:
Error during project file parsing: Microsoft.Build.Exceptions.InvalidProjectFileException: The tools version "14.1" is unrecognized. Available tools versions are "2.0", "3.5", "4.0". C:\workspace_trunk\ProcessBridge.NET\ProcessBridge\ProcessBridge.csproj
bei Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
bei Microsoft.Build.Evaluation.Project.Data.InitializeForEvaluation(IToolsetProvider toolsetProvider)
bei Microsoft.Build.Evaluation.Evaluator`4..ctor(IEvaluatorData`4 data, ProjectRootElement projectRootElement, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly)
bei Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation)
bei Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings)
bei Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
bei Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
bei Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName)
bei ProjectFileParser.ProjectHelpers.LoadProject(String fullPath, IDictionary`2 args)
bei ProjectFileParser.ProjectHelpers.<>c__DisplayClass0_0.<GetProjects>b__1(ProjectInSolution p)
bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
bei System.Linq.Buffer`1..ctor(IEnumerable`1 source)
bei System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
bei ProjectFileParser.ProjectHelpers.GetProjects(SolutionFile solution, IDictionary`2 args)
bei ProjectFileParser.Program.ParseSolution(String file, JObject args)
bei ProjectFileParser.Program.Parse(String file, JObject args)
bei ProjectFileParser.Program.Main(String[] args)
With the follow debug lines:
msbuild {
println getCommandLineArgs()
println msbuild.msbuildDir
}
I can see the right msbuild tool version 15 from VS 2017. But the tool ProjectFileParser.exe seems to use a different version of the tool. How can I solve the problem? How the msbuild.exe are searched in the tool ProjectFileParser.exe?
I've set up the gradle script with the msbuild plugin as stated in the Readme.md. It does not work and throws "Plugin with id 'msbuild' not found".
It does not matter whether I use the 2.9 or 2.10 version and if I try it on Windows or OSX - it should at least be able to set up the plugin and start the process.
Any ideas on this?
I have a build that runs find with plug-in 2.12. I'm using VS 2015 and MS Build 14.0.
Here is my full msbuild configuration:
msbuild {
// .csproj, relative to the project root
projectFile = file("src/main/asp.net/${vsProject}.csproj")
// MsBuild project name (/p:Project=...)
projectName = "${vsProject}"
// Verbosity (/v:detailed, by default uses gradle logging level)
//verbosity = 'detailed'
// targets to execute (/t:Clean;Rebuild, no default)
targets = ['Clean', 'Rebuild']
// ### Project setting overrides ###
// overrides project OutputPath
destinationDir = "${buildDir}/msbuild/bin"
// overrides project IntermediaryOutputPath
intermediateDir = "${buildDir}/msbuild/obj"
// Generates XML documentation file (from javadoc through custom DocLet)
generateDoc = false
// overrides project build configuration
configuration = msbuildConfig
// Other msbuild options can be set:
// loggerAssembly, debugType, optimize, debugSymbols, platform, defineConstants ...
// /Project setting overrides
// ### Build properties (/p:SomeProperty=Value) ###
parameters.DeployOnBuild = 'true'
parameters.PublishProfile = 'Local Build Dir' // Publishes to build/site/
parameters.VisualStudioVersion = '14.0' // VS 2015
}
In 2.13+ builds fail with:
Error during project file parsing: Microsoft.Build.Exceptions.InvalidProjectFileException: The tools version "14.1" is unrecognized. Available tools versions are "14.0", "2.0", "3.5", "4.0".
This might have to do something with children projects. I have two child projects defined and configured in a similar way (to above). If I disable children projects, my main project passes.
Hi!
I've an issue during the execution of msbuild Build target, which was working with older VS versions before.
Environment:
This is important to us now, so I can provide help, also coding help if necessary!
Error during project file parsing: Microsoft.Build.Exceptions.InvalidProjectFileException: Invalid static method invocation syntax: "[Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries(a
, b
)). C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1,T2](IElementLocation elementLocation, String resourceName, T1 arg0, T2 arg1)
at Microsoft.Build.Evaluation.Expander2.Function
1.Execute(Object objectInstance, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation) at Microsoft.Build.Evaluation.Expander
2.PropertyExpander1.ExpandPropertyBody(String propertyBody, Object propertyValue, IPropertyProvider
1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties)
at Microsoft.Build.Evaluation.Expander2.PropertyExpander
1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties) at Microsoft.Build.Evaluation.Expander
2.PropertyExpander1.ExpandPropertiesLeaveEscaped(String expression, IPropertyProvider
1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties)
at Microsoft.Build.Evaluation.Expander2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation) at Microsoft.Build.Evaluation.Evaluator
4.EvaluatePropertyElement(ProjectPropertyElement propertyElement)
at Microsoft.Build.Evaluation.Evaluator4.EvaluatePropertyGroupElement(ProjectPropertyGroupElement propertyGroupElement) at Microsoft.Build.Evaluation.Evaluator
4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator
4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator
4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator
4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator
4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext) at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project.Initialize(IDictionary
2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary
2 globalProperties, String toolsVersion)
at ProjectFileParser.ProjectHelpers.LoadProject(String fullPath, IDictionary`2 args)
at ProjectFileParser.Program.ParseProject(String file, JObject args)
at ProjectFileParser.Program.Parse(String file, JObject args)
at ProjectFileParser.Program.Main(String[] args)
Currently, there is no possibility to build projects, with new format of 'csproj' file, shipped from .NET Core.
Build support of new project format came with MSBuild 15.
See project example:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<RootNamespace>Example</RootNamespace>
<AssemblyName>Example</AssemblyName>
<PackageId>Example</PackageId>
<Authors>Konstantin Posudevskiy</Authors>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<NoPackageAnalysis>true</NoPackageAnalysis>
<PackageTags>.NET</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Antlr4" Version="4.3.0" />
</ItemGroup>
</Project>
Now I receive next exception message:
Error during project file parsing: Microsoft.Build.Exceptions.InvalidProjectFileException: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.
That is exception stack:
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Construction.ProjectParser.Parse()
at Microsoft.Build.Construction.ProjectRootElement..ctor(String path, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext)
at Microsoft.Build.Construction.ProjectRootElement.CreateProjectFromPath(String projectFile, IDictionary`2 globalProperties, String toolsVersion, ILoggingService loggingService, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext)
at Microsoft.Build.Construction.ProjectRootElement.<OpenProjectOrSolution>c__AnonStorey0.<>m__0(String path, ProjectRootElementCache cache)
at Microsoft.Build.Evaluation.ProjectRootElementCache.Get(String projectFile, OpenProjectRootElement openProjectRootElement, Boolean isExplicitlyLoaded)
at Microsoft.Build.Construction.ProjectRootElement.OpenProjectOrSolution(String fullPath, IDictionary`2 globalProperties, String toolsVersion, ILoggingService loggingService, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, Boolean isExplicitlyLoaded)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName)
at ProjectFileParser.ProjectHelpers.LoadProject(String fullPath, IDictionary`2 args)
at ProjectFileParser.Program.ParseProject(String file, JObject args)
at ProjectFileParser.Program.Parse(String file, JObject args)
at ProjectFileParser.Program.Main(String[] args)
Hi,
Currently, AssemblyInfoVersionPatcher supports customizing those fields:
There are additional fields I would like to customize as part of product build:
5. AssemblyTitle
6. AssemblyCompany
7. AssemblyProduct
8. AssemblyCopyright
9. AssemblyTrademark
Is it possible to modify or extend current AssemblyInfoVersionPatcher such that it will get a map as @ Input, where I put all desired fields?
Declaring additional input members is fine as well
Thank you very much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.