2017-10-12 4 views
0

Je tente d'installer une version VSTS pour mon projet LibGdx. Dans ma définition de construction VSTS, j'utilise l'étape de construction Gradle standard, dans laquelle la construction échoue.Création d'un projet libgdx à l'aide de VSTS

Ma trace de la pile de VSTS ressemble à ceci:

07:50:40.981 [INFO] [org.gradle.BuildLogger] Starting Build 
07:50:40.983 [DEBUG] [org.gradle.BuildLogger] Gradle user home: C:\java\gradle\user 
07:50:40.984 [DEBUG] [org.gradle.BuildLogger] Current dir: D:\a\1\s 
07:50:40.987 [DEBUG] [org.gradle.BuildLogger] Settings file: null 
07:50:40.988 [DEBUG] [org.gradle.BuildLogger] Build file: null 
07:50:41.019 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Starting to build the build sources. 
07:50:41.020 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Gradle source dir does not exist. We leave. 
07:50:41.024 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found env project properties: [] 
07:50:41.026 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found system project properties: [] 
07:50:41.725 [DEBUG] [org.gradle.api.internal.artifacts.mvnsettings.DefaultLocalMavenRepositoryLocator] No local repository in Settings file defined. Using default path: C:\Users\buildguest\.m2\repository 
07:50:42.170 [DEBUG] [org.gradle.initialization.ScriptEvaluatingSettingsProcessor] Timing: Processing settings took: 1.144 secs 
07:50:42.174 [INFO] [org.gradle.BuildLogger] Settings evaluated using empty settings script. 
07:50:42.368 [DEBUG] [org.gradle.initialization.ProjectPropertySettingBuildLoader] Looking for project properties from: D:\a\1\s\gradle.properties 
07:50:42.369 [DEBUG] [org.gradle.initialization.ProjectPropertySettingBuildLoader] project property file does not exists. We continue! 
07:50:42.371 [INFO] [org.gradle.BuildLogger] Projects loaded. Root project using empty build file. 
07:50:42.373 [INFO] [org.gradle.BuildLogger] Included projects: [root project 's'] 
07:50:42.733 [INFO] [org.gradle.configuration.project.BuildScriptProcessor] Evaluating root project 's' using empty build file. 
07:50:42.747 [DEBUG] [org.gradle.configuration.project.BuildScriptProcessor] Timing: Running the build script took 0.013 secs 
07:50:42.751 [INFO] [org.gradle.BuildLogger] All projects evaluated. 
07:50:42.781 [ERROR] [org.gradle.BuildExceptionReporter] 
07:50:42.783 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 
07:50:42.784 [ERROR] [org.gradle.BuildExceptionReporter] 
07:50:42.785 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 
07:50:42.786 [ERROR] [org.gradle.BuildExceptionReporter] Task 'build' not found in root project 's'. 
07:50:42.787 [ERROR] [org.gradle.BuildExceptionReporter] 
07:50:42.787 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 
07:50:42.788 [ERROR] [org.gradle.BuildExceptionReporter] Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. 
07:50:42.790 [LIFECYCLE] [org.gradle.BuildResultLogger] 
07:50:42.791 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED 
07:50:42.792 [LIFECYCLE] [org.gradle.BuildResultLogger] 
07:50:42.793 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 10.167 secs 
07:50:42.801 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache artifact cache (C:\java\gradle\user\caches\modules-2) was closed 0 times. 
07:50:42.803 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 0 resolution results binary files in 0.0 secs 
07:50:42.805 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory] In-memory dependency metadata cache closed. Repos cached: 0, cache instances: 0, modules served from cache: 0, artifacts: 0 
Error: d:\a\1\s\7Seas\core\gradlew.bat failed with return code: 1 
    at ChildProcess.<anonymous> (d:\a\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\1.122.0\node_modules\vsts-task-lib\toolrunner.js:569:30) 
    at emitTwo (events.js:106:13) 
    at ChildProcess.emit (events.js:191:7) 
    at maybeClose (internal/child_process.js:886:16) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 
##[error]Error: d:\a\1\s\7Seas\core\gradlew.bat failed with return code: 1 
##[section]Finishing: gradlew build 

Je soupçonnais que la construction tente d'exécuter la commande « build » dans le mauvais répertoire. Le répertoire actuel ne devrait-il pas être: D: \ a \ 1 \ s \ ProjName?

Mon fichier emballage gradle est ici:

@if "%DEBUG%" == "" @echo off 
@rem ########################################################################## 
@rem 
@rem Gradle startup script for Windows 
@rem 
@rem ########################################################################## 

@rem Set local scope for the variables with windows NT shell 
if "%OS%"=="Windows_NT" setlocal 

set DIRNAME=%~dp0 
if "%DIRNAME%" == "" set DIRNAME=. 
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= 

@rem Find java.exe 
if defined JAVA_HOME goto findJavaFromJavaHome 

set JAVA_EXE=java.exe 
%JAVA_EXE% -version >NUL 2>&1 
if "%ERRORLEVEL%" == "0" goto init 

echo. 
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 
echo. 
echo Please set the JAVA_HOME variable in your environment to match the 
echo location of your Java installation. 

goto fail 

:findJavaFromJavaHome 
set JAVA_HOME=%JAVA_HOME:"=% 
set JAVA_EXE=%JAVA_HOME%/bin/java.exe 

if exist "%JAVA_EXE%" goto init 

echo. 
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 
echo. 
echo Please set the JAVA_HOME variable in your environment to match the 
echo location of your Java installation. 

goto fail 

:init 
@rem Get command-line arguments, handling Windows variants 

if not "%OS%" == "Windows_NT" goto win9xME_args 

:win9xME_args 
@rem Slurp the command line arguments. 
set CMD_LINE_ARGS= 
set _SKIP=2 

:win9xME_args_slurp 
if "x%~1" == "x" goto execute 

set CMD_LINE_ARGS=%* 

:execute 
@rem Setup the command line 

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 

@rem Execute Gradle 
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 

:end 
@rem End local scope for the variables with windows NT shell 
if "%ERRORLEVEL%"=="0" goto mainEnd 

:fail 
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 
rem the _cmd.exe /c_ return code! 
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 
exit /b 1 

:mainEnd 
if "%OS%"=="Windows_NT" endlocal 

:omega 

et mes gradle-wrapper.properties fichier:

#Thu Oct 12 08:51:38 CEST 2017 
distributionBase=GRADLE_USER_HOME 
distributionPath=wrapper/dists 
zipStoreBase=GRADLE_USER_HOME 
zipStorePath=wrapper/dists 
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip 
+0

Comment créez-vous ce projet? Quel est le résultat si vous le construisez à travers le répertoire gradlew sur votre machine locale? Pourriez-vous partager le projet exemple simple sur le OneDrive? –

+0

C'est un projet sur lequel j'ai travaillé depuis plusieurs mois et j'ai décidé d'utiliser VSTS comme serveur de build. Le projet a été créé en utilisant le générateur de projet LibGdx. Le projet se construit parfaitement sur ma machine locale. Depuis que j'ai demandé de recommencer avec un nouveau projet, je me suis assuré que cela pourrait construire dans VSTS, puis déplacer le code, les tests et les actifs par étapes, en s'assurant qu'il pourrait continuer à construire. Il fonctionne maintenant :) – esser

Répondre

0

La solution est que vous pouvez créer un nouveau projet et assurez-vous qu'il pourrait construire dans VSTS, puis déplacez le code vers le nouveau projet.