diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f6debe..3a17061 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # gradle-msbuild-plugin changelog +# 3.7 +### Fixed +* Unzip binaries into temporaryDir of the task + # 3.6 ### Added * Support finding msbuild buildtools from VS2019 installation diff --git a/README.md b/README.md index f35e66c..3ad03fe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Gradle MsBuild Plugin [![Build status](https://ci.appveyor.com/api/projects/status/dx29ov4txa120okx/branch/master?svg=true)](https://ci.appveyor.com/project/gluck/gradle-msbuild-plugin/branch/master) [![Build Status](https://travis-ci.org/Ullink/gradle-msbuild-plugin.svg?branch=master)](https://travis-ci.org/Ullink/gradle-msbuild-plugin) +# Gradle MsBuild Plugin [![Build status](https://ci.appveyor.com/api/projects/status/dx29ov4txa120okx/branch/master?svg=true)](https://ci.appveyor.com/project/gluck/gradle-msbuild-plugin/branch/master) [![Build Status](https://travis-ci.org/Itiviti/gradle-msbuild-plugin.svg?branch=master)](https://travis-ci.org/Itiviti/gradle-msbuild-plugin) This plugin allows to compile an MsBuild project. It also supports project file parsing, and some basic up-to-date checks to skip the build. @@ -24,7 +24,7 @@ To apply the plugin: ```groovy // Starting from gradle 2.1 plugins { - id 'com.ullink.msbuild' version '3.1' + id 'com.ullink.msbuild' version '3.7' } ``` @@ -36,7 +36,7 @@ buildscript { } dependencies { - classpath 'com.ullink.gradle:gradle-msbuild-plugin:3.1' + classpath 'com.ullink.gradle:gradle-msbuild-plugin:3.7' } } apply plugin:'com.ullink.msbuild' diff --git a/build.gradle b/build.gradle index ca397ee..f34113d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ plugins { - id 'nu.studer.plugindev' version '1.0.9' + id 'nu.studer.plugindev' version '1.0.12' id 'com.jfrog.bintray' version '1.8.4' - id 'com.ullink.msbuild' version '3.1' - id 'com.ullink.nuget' version '2.15' - id 'com.ullink.nunit' version '1.13' + id 'com.ullink.msbuild' version '3.6' + id 'com.ullink.nuget' version '2.18' + id 'com.ullink.nunit' version '2.0' id 'net.researchgate.release' version '2.6.0' id 'de.undercouch.download' version '3.4.3' } @@ -25,10 +25,6 @@ dependencies { compile 'com.google.guava:guava:27.0.1-jre' } -nuget { - version = '4.4.0' -} - nugetRestore { solutionFile = file('ProjectFileParser.sln') } @@ -41,10 +37,8 @@ msbuild { } nunit { - nunitVersion = '3.0.1' testAssemblies = [ msbuild.projects['ProjectFileParser_Tests'].properties.TargetPath ] } -nunit.dependsOn msbuild task generateZip(dependsOn: nunit, type: Zip) { from (msbuild.mainProject.properties.TargetDir) { @@ -57,7 +51,7 @@ task generateZip(dependsOn: nunit, type: Zip) { } task downloadVsWhere(type: de.undercouch.gradle.tasks.download.Download) { - src 'https://github.com/Microsoft/vswhere/releases/download/2.6.7/vswhere.exe' + src 'https://github.com/Microsoft/vswhere/releases/download/2.8.4/vswhere.exe' dest "$temporaryDir/vswhere.exe" } @@ -76,11 +70,8 @@ sourceSets { } bintray { - // to remove when upgraded plugindev to 1.0.4 - user project.properties.bintrayUser - key project.properties.bintrayApiKey pkg.repo = 'gradle-plugins' - pkg.userOrg = 'ullink' + pkg.userOrg = 'Itiviti' pkg.version.gpg.sign = true } @@ -94,7 +85,7 @@ plugindev { authorId 'gluck' authorName 'Francois Valdy' authorEmail 'francois.valdy@gmail.com' - projectUrl "https://github.com/Ullink/${project.name}" + projectUrl "https://github.com/Itiviti/${project.name}" projectInceptionYear '2012' done() } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 736fb7d..5c2d1cf 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e8289e8..f04d6a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-bin.zip diff --git a/gradlew b/gradlew index af6708f..83f2acf 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m"' +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat index 6d57edc..9618d8d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/src/main/groovy/com/ullink/Msbuild.groovy b/src/main/groovy/com/ullink/Msbuild.groovy index 47bcea3..ed2dac3 100644 --- a/src/main/groovy/com/ullink/Msbuild.groovy +++ b/src/main/groovy/com/ullink/Msbuild.groovy @@ -84,28 +84,24 @@ class Msbuild extends ConventionTask { if (!file.exists()) { throw new GradleException("Project/Solution file $file does not exist") } - File tempDir = Files.createTempDirectory('ProjectFileParser').toFile() - tempDir.deleteOnExit() + File tempDir = Files.createTempDirectory(temporaryDir.toPath(), 'ProjectFileParser').toFile() - def zipFileStream = this.class.getResourceAsStream("/META-INF/ProjectFileParser.zip") - ZipInputStream zis = new ZipInputStream(zipFileStream) - ZipEntry ze = zis.getNextEntry() - while (ze != null) { - String fileName = ze.getName() - if (ze.isDirectory()) { - File subFolder = new File(tempDir, fileName) - subFolder.mkdir() - subFolder.deleteOnExit() + this.class.getResourceAsStream('/META-INF/ProjectFileParser.zip').withCloseable { + ZipInputStream zis = new ZipInputStream(it) + ZipEntry ze = zis.getNextEntry() + while (ze != null) { + String fileName = ze.getName() + if (ze.isDirectory()) { + File subFolder = new File(tempDir, fileName) + subFolder.mkdir() + ze = zis.getNextEntry() + continue + } + File target = new File(tempDir, fileName) + target.newOutputStream().leftShift(zis).close() ze = zis.getNextEntry() - continue } - File target = new File(tempDir, fileName) - target.newOutputStream().leftShift(zis).close() - target.deleteOnExit() - ze = zis.getNextEntry() } - zis.closeEntry() - zis.close() def executable = new File(tempDir, 'ProjectFileParser.exe') def builder = resolver.executeDotNet(executable) diff --git a/src/main/groovy/com/ullink/MsbuildResolver.groovy b/src/main/groovy/com/ullink/MsbuildResolver.groovy index a55cad2..9a1731b 100644 --- a/src/main/groovy/com/ullink/MsbuildResolver.groovy +++ b/src/main/groovy/com/ullink/MsbuildResolver.groovy @@ -13,8 +13,7 @@ class MsbuildResolver implements IExecutableResolver { // Find msbuild >= 15.0 by vswhere static def findMsbuildByVsWhere(Msbuild msbuild) { - File tempDir = Files.createTempDirectory('vswhere').toFile() - tempDir.deleteOnExit() + File tempDir = Files.createTempDirectory(msbuild.temporaryDir.toPath(), 'vswhere').toFile() def vswhereFile = new File(tempDir, 'vwshere.exe') Resources.asByteSource(MsbuildResolver.getResource("/vswhere.exe")).copyTo(com.google.common.io.Files.asByteSink(vswhereFile)) diff --git a/src/main/resources/META-INF/gradle-plugins/msbuild.properties b/src/main/resources/META-INF/gradle-plugins/msbuild.properties deleted file mode 100644 index f833ac2..0000000 --- a/src/main/resources/META-INF/gradle-plugins/msbuild.properties +++ /dev/null @@ -1,2 +0,0 @@ -# for backward compat with legacy plugin apply -implementation-class=com.ullink.MsbuildPlugin