Skip to content

Commit

Permalink
Do not include the extension in the windows project name, #23
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Apr 26, 2017
1 parent 9165154 commit 6b58328
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ public class BuildMojo extends AbstractMojo {

/**
* The name of the msbuild/vcbuild project to use.
* Defaults to 'vs2010.vcxproj' for 'msbuild'
* and 'vs2008.vcproj' for 'vcbuild'.
* Defaults to 'vs2010' for 'msbuild'
* and 'vs2008' for 'vcbuild'.
*
* @parameter
*/
Expand Down Expand Up @@ -306,13 +306,13 @@ private void vsBasedBuild(File buildDir) throws CommandLineException, MojoExecut

if( useMSBuild ) {
// vcbuild was removed.. use the msbuild tool instead.
int rc = cli.system(buildDir, new String[]{"msbuild", windowsProjectName != null ? windowsProjectName : "vs2010.vcxproj", "/property:Platform="+platform, "/property:Configuration="+configuration});
int rc = cli.system(buildDir, new String[]{"msbuild", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".vcxproj", "/property:Platform="+platform, "/property:Configuration="+configuration});
if( rc != 0 ) {
throw new MojoExecutionException("vcbuild failed with exit code: "+rc);
}
} else {
// try to use a vcbuild..
int rc = cli.system(buildDir, new String[]{"vcbuild", "/platform:"+platform, windowsProjectName != null ? windowsProjectName : "vs2008.vcproj", configuration});
int rc = cli.system(buildDir, new String[]{"vcbuild", "/platform:"+platform, (windowsProjectName != null ? windowsProjectName : "vs2008") + ".vcproj", configuration});
if( rc != 0 ) {
throw new MojoExecutionException("vcbuild failed with exit code: "+rc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ public class GenerateMojo extends AbstractMojo {

/**
* The name of the msbuild/vcbuild project to use.
* Defaults to 'vs2010.vcxproj' for 'msbuild'
* and 'vs2008.vcproj' for 'vcbuild'.
* Defaults to 'vs2010' for 'msbuild'
* and 'vs2008' for 'vcbuild'.
*
* @parameter
*/
private String windowsProjectName;

Expand Down Expand Up @@ -248,12 +250,12 @@ private void generateBuildSystem() throws MojoExecutionException {
// To support windows based builds..
String tool = windowsBuildTool.toLowerCase().trim();
if( "detect".equals(tool) ) {
copyTemplateResource("vs2008.vcproj", true);
copyTemplateResource("vs2010.vcxproj", true);
copyTemplateResource("vs2008.vcproj", (windowsProjectName != null ? windowsProjectName : "vs2008") + ".vcproj", true);
copyTemplateResource("vs2010.vcxproj", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".vcxproj", true);
} else if( "msbuild".equals(tool) ) {
copyTemplateResource("vs2010.vcxproj", windowsProjectName != null ? windowsProjectName : "vs2010.vcxproj", true);
copyTemplateResource("vs2010.vcxproj", (windowsProjectName != null ? windowsProjectName : "vs2010") + ".vcxproj", true);
} else if( "vcbuild".equals(tool) ) {
copyTemplateResource("vs2008.vcproj", windowsProjectName != null ? windowsProjectName : "vs2008.vcproj", true);
copyTemplateResource("vs2008.vcproj", (windowsProjectName != null ? windowsProjectName : "vs2008") + ".vcproj", true);
} else if( "none".equals(tool) ) {
} else {
throw new MojoExecutionException("Invalid setting for windowsBuildTool: "+windowsBuildTool);
Expand Down

0 comments on commit 6b58328

Please sign in to comment.