environment:
- windows server 2008
- jdk 1.7_051
- gradle 1.11
- flex sdk
1. Installation
a. Install gradle 1.11. Unzip gradle-1.11-all.zip
1) Set gradle home in the environment change face: GRADLE_HOME=d:\gradle
2) Set PATH to join: %GRADLE_HOME%\bin
3) Test whether gradle is installed and set up successfully: open cmd and enter gradle -v to view
Gradlefx will be downloaded when it is used for the first time, so the machine needs to be connected to the Internet, otherwise, set up a nexus private server that can access the Internet, and the private server can be downloaded online.
b. Install flex_sdk_4.6.0.23201B.
1) Unzip it
2)FLEX_HOME=D:\Flex
2. Configure gradle
Write build.gradle under the build folder of each layer
Included
buildscript {
repositories {
maven {
name 'mavenLocal'
url "http://172.XX.XX.XX:8081/nexus/content/groups/public" //Here is the maven private server address
}
}
dependencies {
classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.8.1'
}
}
apply plugin: 'gradlefx'
type='swc'
srcDirs = [/src/main/flex']
3. Execute
Execute the batch with Jenkins call:
In the directory containing build.gradle, execute gradle build.
Generate the swc file in the build folder under this folder
Problems encountered:
After the jenkins configuration, it always reports an error:
Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
... ...
After searching on the Internet, it is necessary to cancel the setting of JAVA_OPTS.
Operation method:
Go to gradle1.11 software, under bin, modify gradle.bat
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -CLASSPATH "%classpath%" org.gradle.launcher.GradleMain %CMD_LINE_ARGS%
change to
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -CLASSPATH "%classpath%" org.gradle.launcher.GradleMain %CMD_LINE_ARGS%
Run the task again and the error is gone