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

Make WinP Debuggable #36

Merged
merged 8 commits into from
Apr 18, 2017
11 changes: 6 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
skip_tags: true
skip_branch_with_pr: true

version: 1.25.0.{build}-SNAPSHOT

# MVS Project configuration
image: Visual Studio 2013
platform: Any CPU
Expand All @@ -19,11 +21,10 @@ install:

# Build and test
build_script:
- .\build.cmd cleanbuild

# Publish the JAR file as an artifact
after_build:
- ps: Get-ChildItem target\winp-*.jar | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- .\build.cmd cleanbuild Release %APPVEYOR_BUILD_VERSION%
- ps: Get-ChildItem target\winp-$env:APPVEYOR_BUILD_VERSION.jar | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
- .\build.cmd cleanbuild Debug %APPVEYOR_BUILD_VERSION%-Debug
- ps: Get-ChildItem target\winp-$env:APPVEYOR_BUILD_VERSION-Debug.jar | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

on_finish:
# TODO: enable once there are tests, implement aggregator somehow
Expand Down
49 changes: 30 additions & 19 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,59 @@ set PATH=%PATH%;%ProgramFiles(x86)%\MSBuild\12.0\Bin\;
set BUIDROOT=%cd%

:getopts
if "%2"=="" (
set configuration="Release"
) else (
set configuration=%2%
)

if "%3"=="" (
echo No target version specified, will determine it from POM
REM TODO: Apply some MADSKILLZ to do it without the temporary file?
call mvn -q -Dexec.executable="cmd.exe" -Dexec.args="/c echo ${project.version}" --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec > version.txt
for /f "delims=" %%x in (version.txt) do set version=%%x
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I already regret I wrote it in Batch

) else (
echo Setting MVN project version to the externally defined %3%
set version=%3%
)
echo Target version is %version%

if "%1"=="" (goto :default) else (goto :%1)
goto :exit

:default
goto :cleanbuild

:cleanbuild
echo "### Cleaning the build directory"
echo ### Cleaning the %configuration% build directory
cd %BUIDROOT%\native
msbuild winp.vcxproj /t:Clean /p:Configuration=Release /verbosity:minimal /nologo /p:Platform="Win32"
if %errorlevel% neq 0 exit /b %errorlevel%
msbuild winp.vcxproj /t:Clean /p:Configuration=Release /verbosity:minimal /nologo /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%
msbuild winp.vcxproj /t:Clean /p:Configuration=Debug /verbosity:minimal /nologo /p:Platform="Win32"
msbuild winp.vcxproj /t:Clean /p:Configuration=%configuration% /verbosity:minimal /nologo /p:Platform="Win32"
if %errorlevel% neq 0 exit /b %errorlevel%
msbuild winp.vcxproj /t:Clean /p:Configuration=Debug /verbosity:minimal /nologo /p:Platform="x64"
msbuild winp.vcxproj /t:Clean /p:Configuration=%configuration% /verbosity:minimal /nologo /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%
goto :build

:build
echo "### Building project configurations"
echo ### Building the %configuration% configuration
cd %BUIDROOT%\native
REM /verbosity:minimal
msbuild winp.vcxproj /p:Configuration=Release /nologo /p:Platform="Win32"
msbuild winp.vcxproj /p:Configuration=%configuration% /nologo /p:Platform="Win32"
if %errorlevel% neq 0 exit /b %errorlevel%
msbuild winp.vcxproj /p:Configuration=Release /nologo /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%
msbuild winp.vcxproj /p:Configuration=Debug /nologo /p:Platform="Win32"
if %errorlevel% neq 0 exit /b %errorlevel%
msbuild winp.vcxproj /p:Configuration=Debug /nologo /p:Platform="x64"
msbuild winp.vcxproj /p:Configuration=%configuration% /nologo /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

echo "### Updating WinP resource files"
echo ### Updating WinP resource files for the %configuration% build
cd %BUIDROOT%
COPY native\Release\winp.dll src\main\resources\winp.dll
COPY native\%configuration%\winp.dll src\main\resources\winp.dll
if %errorlevel% neq 0 exit /b %errorlevel%
COPY native\x64\Release\winp.dll src\main\resources\winp.x64.dll
COPY native\x64\%configuration%\winp.dll src\main\resources\winp.x64.dll
if %errorlevel% neq 0 exit /b %errorlevel%

echo "### Build and Test winp.jar"
echo ### Build and Test winp.jar for %version%
cd %BUIDROOT%
mvn --batch-mode clean package verify
call mvn -q --batch-mode versions:set -DnewVersion=%version%
if %errorlevel% neq 0 exit /b %errorlevel%
call mvn --batch-mode clean package verify
if %errorlevel% neq 0 exit /b %errorlevel%
goto :exit

Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
Expand All @@ -38,6 +39,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<forkMode>never</forkMode>
</configuration>
Expand Down Expand Up @@ -69,6 +71,7 @@
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
</plugin>
</plugins>
</reporting>
Expand Down