Attempt to configure Maven on appveyor

This commit is contained in:
Antonin Delpeuch 2018-09-07 14:14:37 +01:00
parent 4eeefe75f4
commit 7590fd149d
2 changed files with 19 additions and 25 deletions

View File

@ -11,24 +11,19 @@ clone_depth: 5
skip_branch_with_pr: true skip_branch_with_pr: true
environment: environment:
ANT_HOME: C:\apache-ant-1.10.5
JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0 JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0
MAVEN_HOME: C:\Program Files\Apache\maven
matrix: matrix:
fast_finish: true fast_finish: true
install:
- cmd: if not exist %ANT_HOME% pushd . && cd \ && appveyor DownloadFile http://www.mirrorservice.org/sites/ftp.apache.org//ant/binaries/apache-ant-1.10.5-bin.zip && 7z x apache-ant-1.10.5-bin.zip && popd
cache:
- C:\apache-ant-1.10.5
- apache-ant-1.10.5-bin.zip
build: off build: off
# scripts to run before test # scripts to run before test
before_test: before_test:
- cmd: echo Running scripts before build... - cmd: echo Running scripts before build...
- cmd: |- - cmd: |-
echo %PATH%
PATH=C:\Program Files\PostgreSQL\9.6\bin\;C:\Program Files\MySQL\MySQL Server 5.7\bin\;%PATH% PATH=C:\Program Files\PostgreSQL\9.6\bin\;C:\Program Files\MySQL\MySQL Server 5.7\bin\;%PATH%
SET MYSQL_PWD=Password12! SET MYSQL_PWD=Password12!
mysql -u root --password=Password12! -e "create database test_db;" mysql -u root --password=Password12! -e "create database test_db;"

View File

@ -3,8 +3,8 @@ rem @echo off
rem rem
rem Configuration variables rem Configuration variables
rem rem
rem ANT_HOME rem MAVEN_HOME
rem Home of Ant installation; copy is in the source as tools\apache-ant-* rem Home of Maven installation; copy is in the source as tools\apache-ant-*
rem rem
rem JAVA_HOME rem JAVA_HOME
rem Home of Java installation. rem Home of Java installation.
@ -184,12 +184,11 @@ rem ----- Respond to the action ------------------------------------------------
set ACTION=%1 set ACTION=%1
if ""%ACTION%"" == ""build"" goto doAnt if ""%ACTION%"" == ""build"" goto doMvn
if ""%ACTION%"" == ""server_test_debug"" goto doAntDebug if ""%ACTION%"" == ""server_test"" goto doMvn
if ""%ACTION%"" == ""server_test"" goto doAnt if ""%ACTION%"" == ""extensions_test"" goto doMvn
if ""%ACTION%"" == ""extensions_test"" goto doAnt if ""%ACTION%"" == ""clean"" goto doMvn
if ""%ACTION%"" == ""clean"" goto doAnt if ""%ACTION%"" == ""distclean"" goto doMvn
if ""%ACTION%"" == ""distclean"" goto doAnt
if ""%ACTION%"" == ""run"" goto doRun if ""%ACTION%"" == ""run"" goto doRun
:doRun :doRun
@ -215,24 +214,24 @@ set CLASSPATH="%REFINE_CLASSES_DIR%;%REFINE_LIB_DIR%\*"
"%JAVA_HOME%\bin\java.exe" -cp %CLASSPATH% %OPTS% -Djava.library.path=%REFINE_LIB_DIR%/native/windows com.google.refine.Refine "%JAVA_HOME%\bin\java.exe" -cp %CLASSPATH% %OPTS% -Djava.library.path=%REFINE_LIB_DIR%/native/windows com.google.refine.Refine
goto end goto end
:doAnt :doMvn
if not "%ANT_HOME%" == "" goto gotAntHome if not "%MAVEN_HOME%" == "" goto gotMvnHome
echo You must have Apache Ant installed and the ANT_HOME environment variable to point to it echo You must have Apache Maven installed and the MAVEN_HOME environment variable to point to it
echo. echo.
echo You can download it from echo You can download it from
echo. echo.
echo http://ant.apache.org/ echo https://maven.apache.org/
echo. echo.
echo If you don't know how to set environment variables, follow the instructions at echo If you don't know how to set environment variables, follow the instructions at
echo. echo.
echo http://bit.ly/1c2gkR echo http://bit.ly/1c2gkR
echo. echo.
:gotAntHome :gotMvnHome
"%ANT_HOME%\bin\ant.bat" -f build.xml %ACTION% set MVN_ACTION=""%ACTION%""
goto end if ""%ACTION%"" == ""build"" set MVN_ACTION=""compile""
if ""%ACTION%"" == ""server_test"" set MVN_ACTION=""test -pl main""
:doAntDebug if ""%ACTION%"" == ""extensions_test"" set MVN_ACTION=""test -pl extensions""
"%ANT_HOME%\bin\ant.bat" -f -v -diagnostics build.xml %ACTION% "%MAVEN_HOME%\bin\mvn.cmd" %MVN_ACTION%
goto end goto end
:end :end