I'm trying to set up Jenkins to build a GWT project, but I got this error
gwt-compile-module:
[java] Jul 01, 2014 2:08:59 PM java.util.prefs.FileSystemPreferences$1 run
[java] INFO: Created user preferences directory.
[java] Loading inherited module 'OBFUSCATE'
[java] [ERROR] Unable to find 'OBFUSCATE.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
I have gwt-user.jar, gwt-dev.jar, validation-api-1.0.0.GA-sources.jar and validation-api-1.0.0.GA.jar in the class path.
OBFUSCATE.gwt.xml must be some GWT base module but cannot find it anywhere.
Here is the snippet from build.xml:
<target name="gwt-compile-module" description="Build one GWT module - java to javascript">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="${src.dir}"/>
<pathelement location="${build.dir}"/>
<path refid="project.classpath"/>
</classpath>
<jvmarg value="-Xmx1024M"/>
<arg value="-optimize"/>
<arg value="${optimize}"/>
<arg value="-localWorkers"/>
<arg value="${localWorkers}"/>
<arg value="-war" />
<arg value="${gwt.output.dir}" />
<arg value="${draftCompile}" />
<arg value="${gwt.modules}${gwt.module}"/>
<arg line="-style OBFUSCATE"/>
</java>
</target>
I guess you should rearrange your arg options and place <arg line="-style OBFUSCATE"/> before <arg value="${gwt.modules}${gwt.module}"/>:
<arg line="-style OBFUSCATE"/>
<arg value="${gwt.modules}${gwt.module}"/>
I want to run this working line of code in ant-script:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO -workspace \APPNAME.xcworkspace -scheme APPNAMETarget build
So far I have this:
<?xml version="1.0" encoding="utf-8"?>
<project name="APPNAME" default="debugbuild" basedir=".">
<target name="debugbuild">
<echo message="Building debug build of APPNAME" />
<exec executable="/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" os="Mac OS X">
<arg value="-workspace"/>
<arg value="APPNAME.xcworkspace"/>
<arg value="-scheme"/>
<arg value="APPNAMETarget"/>
<arg value="build"/>
</exec>
</target>
</project>
But I also need to add Build Settings (ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO) but don't know how to add them in the script. I tried
<env key="ONLY_ACTIVE_ARCH" value="NO"/>
But it didn't work.
I found a solution. I just had to add them as arguments like the other but I had to get rid of the parenthesis which were fine in the command line. I hope it is helpful for other because I spend some time on this:
<?xml version="1.0" encoding="utf-8"?>
<project name="APPNAME" default="debugbuild" basedir=".">
<target name="debugbuild">
<echo message="Building debug build of APPNAME" />
<exec executable="/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" os="Mac OS X">
<arg value="-workspace"/>
<arg value="APPNAME.xcworkspace"/>
<arg value="-scheme"/>
<arg value="APPNAMETarget"/>
<arg value="build"/>
<arg value="ARCHS=armv7 armv7s"/>
<arg value="ONLY_ACTIVE_ARCH=NO"/>
</exec>
</target>
</project>
Can you give me a simple example of nant build file which builds watin/nunit tests from .csproj file with all needed dependencies?
Here is my nant build file which I finally designed for my project:
<?xml version="1.0"?>
<project name="WatInTests" default="test">
<include buildfile="common.properties" />
<include buildfile="properties_watin.properties" />
<property name="run.dir" value="${jenkins.jobs.dir}\<my_project>\workspace" />
<property name="currentFileset" value="${projectFileset}"/>
<property name="precondition.test" value="${currentFileset}.Tests.PreconditionTest"/>
<property name="results.folder" value="${results.dir}\${now.datetime}"/>
<target name="clean">
<delete verbose="true">
<fileset basedir="${project.build.dir}">
<include name="**\*" />
</fileset>
</delete>
<copy file="App.config"
tofile="${uitests.dir}\${currentFileset}\App.config" inputencoding="utf-8"
outputencoding="utf-8" overwrite="true">
<filterchain>
<expandproperties />
</filterchain>
</copy>
</target>
<target name="build" depends="clean">
<echo message="Start building ${currentFileset}"/>
<copy file="${nunit.reference}" todir="${uitests.dir}\${currentFileset}\bin\debug" failonerror="true"/>
<copy file="${nunit_core.reference}" todir="${uitests.dir}\${currentFileset}\bin\debug" failonerror="true"/>
<exec program="${project.utils.msbuild.exe}" workingdir="${uitests.dir}\${currentFileset}">
<arg value="${ProjectSlnPath}"></arg>
<arg value="/p:Configuration=${BuildMode}"></arg>
</exec>
<echo message="Build succeeded"/>
<echo message="Copy build to ${run.dir}"/>
<copy todir="${run.dir}" overwrite="true">
<fileset basedir="${watintests.dir}\${currentFileset}\bin\debug">
<exclude name="*.svn" />
</fileset>
</copy>
</target>
<target name="precondition" depends="build">
<mkdir dir="${results.folder}" />
<exec program="${nunit.file}" failonerror="true" verbose="true" workingdir="${run.dir}">
<arg value="/run:${precondition.test}" />
<arg value="${run.dir}\${nunit.config.file}" />
</exec>
</target>
<target name="test" depends="precondition">
<exec program="${nunit.file}" verbose="true" workingdir="${run.dir}">
<arg value="/exclude:Precondition" />
<arg value="${run.dir}\${nunit.config.file}" />
</exec>
<copy file="${run.dir}\TestResult.xml" todir="${results.folder}" failonerror="true"/>
</target>
</project>
I have an eclipse rcp application being developed in eclipse 3.5. I am able to successfully execute pde headless build in ant (from command shell outside eclipse) via the following target entry:
<target name="compile">
<java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true" dir="some-dir">
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
<arg value="${eclipse.location}/plugins/org.eclipse.pde.build_${some-version}/scripts/productBuild/productBuild.xml" />
<arg value="-Dtimestamp=${timestamp}" />
<arg value="-propertyfile" />
<arg value="${some-dir}/ant.properties" />
<classpath>
<pathelement
location="${eclipse.location}/plugins/org.eclipse.equinox.launcher_${some-version}.jar" />
</classpath>
</java>
</target>
But once AspectJ (AJDT) got involved, I modified the target above like so:
<target name="compile">
<java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true" dir="${some-dir}">
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
**<arg value="${eclipse.location}/plugins/org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900/scripts/productBuild/productBuild.xml" />**
<arg value="-Dtimestamp=${timestamp}" />
<arg value="-propertyfile" />
<arg value="${some-dir}/ant.properties" />
**<jvmarg value="-Dajdt.pdebuild.home=${eclipse.location}/plugins/org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900" />**
<classpath>
<pathelement
location="${eclipse.location}/plugins/org.eclipse.equinox.launcher_${some-version}.jar" />
</classpath>
</java>
</target>
Unfortunately, I am now getting the following error:
c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\productBuild.xml:8: Cannot find ${ajdt.pdebuild.scripts}/productBuild/allElements.xml imported from c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\productBuild.xml
does anyone have any idea on how to set the ajdt.pdebuild.scripts value? thank you!!!
See this blog post:
http://contraptionsforprogramming.blogspot.com/2010/03/ajdt-pde-builds-redux.html
You should not be using AJDT-PDE. That is the old way of doing things and is no longer supported. Instead, you should be making changes to your build.properties file:
# required
compilerAdapter=org.eclipse.ajdt.core.ant.AJDT_AjcCompilerAdapter
sourceFileExtensions=*.java, *.aj
# optional
compilerArg=-aspectpath other.jar
Read the blog post for more details.
there are several steps needed to wrangle ajdt-pde headless build to execute in eclipse 3.5:
1) add ajdt.pdebuild.scripts param with its respective value as a "jvmarg" to the above-shown "java" block.
2) in .../scripts/productBuild/productBuild.xml, change property name="allElementsFile" value="productBuild/allElements.xml" to this property name="allElementsFile" value="${ajdt.pdebuild.scripts}/productBuild/allElements.xml"
3) in .../scripts/productBuild/productBuild.xml, comment out import file="${ajdt.pdebuild.scripts}/productBuild/allElements.xml"
4) in .../scripts/productBuild/productBuild.xml, paste the following import statement: import file="${ajdt.pdebuild.scripts}/build.xml"
We have an app that has crashed on armv6 iOS devices coming from the App Store. armv7 iOS devices ran it just fine. When the app was built and tested as debug, it ran just fine on both armv6 and armv7. In the logs, I was getting EXC_BAD_INSTRUCTION when it tried to construct an object from a library. The crash appeared to be a linking error on the release build since I have several static libraries from three20. At first I thought it was an iOS version problem, but its now looking like a "fat binary" issue.
Is ad-hoc the best way to have a simulated App Store for testing? What is the best way to test a release build on an device? What would be the best way to test the linking with the different devices on a release build?
I can't find a reference to the iOS compatibility testing labs but I heard this is presently available. If I can find this resource, I'll update my response.
In the mean time, you can find UI automation testing advice here: Automated testing for iPhone
Unfortunately, you'll have to find a 3g iPhone to verify arm6 compatibility. I expect you should be able to find one easy enough just by asking everyone you know who has a new iPhone. They probably have their old phone sitting in a drawer like I do. I use mine for testing.
If you can justify a sophisticated solution, you could permanently attach the old iPhone to a mac mini and drive the UI using the above referenced UI testing frameworks using Hudson or CruiseControl. This would be the most reliable and least time consuming approach if you can make that up front investment.
You can change the code signature authority on a built app using the codesign command-line tool. After building your distribution target, the app file will have a "distribution" authority; you need to change it to development authority. After the change, you can then install the build on a development device and test away.
To see a verbose dump of the app signature:
$ codesign -d -vv MyApp.app/MyApp
To change the codesign authority:
$ codesign -f -s "My iPhone Developer Name" -vv MyApp.app/MyApp
You might need to create an environment variable to grab the correct version of codesign_allocate:
$ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
I found these directions on Craig Hockenberry's blog, with lots of additional information on this process: http://furbo.org/2008/11/12/the-final-test/
I was able to test it using ad-hoc distribution.
I use ANT to create releases, utilizing the xcodebuild command line utility. The ant target looks like this:
<target name="build-adhoc">
<echo>Running XCODE compiler</echo>
<exec executable="xcodebuild" failonerror="true" vmlauncher="false" dir="${connect_src}">
<arg value="build"/>
<arg value="-target" />
<arg value="myappname" />
<arg value="-configuration"/>
<arg value="AdHoc"/>
<arg value="SYMROOT=${export_app}-${version.number}/AdHoc" />
<env key="USER_HEADER_SEARCH_PATHS" value="/tmp/build/trunk/Libraries/somesource/**\ /tmp/build/trunk/Libraries/somemoresource/**"/>
</exec>
<echo>xcode build complete</echo>
</target>
Create a configuration for your ad hoc release and make sure it uses an ad hoc ready provisioning profile. Or, you can create a normal, non-ad hoc configuration that uses your Developer provisioning profile. If you do the former, you can email the product, along with your provisioning profile, to testers. If you do the latter, you can use the iPhone Config Utility to install on any device in the profile.
Also, we have the ANT target setup with dependencies on doing a fresh checkout from source control and doing the build from there. Finally, we do a build right after that using a real App Store-ready configuration so we can test the first build and ship the second to Apple, with some level of certainty that the code behavior will be the same.
Here is a summary of our ANT targets in order of processing:
set env vars needed for builds
clear checkout and build directories
checkout HEAD from source control
modify plists to remove debug and elements only for internal use (using PLISTBUDDY)
Increment build version (using agvtool)
Run unit tests (this needs the sdk setting set to iphonesimulator4.x and a special target -- see iPhone Developers Guide for unit testing)
Do internal build (using either dev profile or ad hoc profile)
Do distribution build (using App Store distribution certificate)
Checkin plist files that have the new build version
Do a tag in source control indicating the build
Report build statistics (build version, location, etc.)
NOTE: make sure you set the SYMROOT env variable in the xcodebuild command syntax so your build ends up in the proper directory. We've had problems copying App Store builds after the fact.
Here is the full ANT script used to create multiple builds, one for testing and one for distribution. For example: "ant distribution" will create one build using the dev profile and one using the App Store distribution profile.
This script is "cleaned," so it only serves as a model from which to start:
<?xml version="1.0" ?>
<project basedir="." default="xcode-build" name="Temp">
<property file="build.properties" />
<property name = "CONFIGURATION_INTERNAL" value = "InternalRelease" />
<property name = "CONFIGURATION_DISTRIBUTION" value = "Distribution" />
<property name = "CONFIGURATION_ADHOC" value = "InternalAdHoc" />
<property name="cvsroot" value=":pserver:${username}:${password}#${cvsurl}"/>
<tstamp>
<format property="TODAY"
pattern="MM-dd-yyyy"
locale="en,US"/>
</tstamp>
<target name="init">
<echo message="deleting old directories" />
<delete dir="${check_out_location}"/>
<mkdir dir="${check_out_location}"/>
</target>
<target name="set-source-trees" depends="init">
<echo message="exporting source tree variables" />
<echo message="${somesourcedir}" />
<exec executable="/bin/bash" os=" Mac OS X">
<arg value="-c" />
<arg value="${export_src_trees}"/>
<arg value="${anothersourcedir}"/>
</exec>
<exec executable="/bin/bash" os=" Mac OS X">
<arg value="-c" />
<arg value="${export_src_trees}"/>
<arg value="${yetanothersourcedir}"/>
</exec>
</target>
<target name="cvs-login" depends="init" description="CVS Login">
<echo>Login CVS</echo>
<cvs cvsroot=":pserver:${username}:${password}#${cvsurl}" command="login" />
</target>
<target name="checkout" depends="cvs-login" description="Check out source from CVS">
<echo message="check out from CVS ...." />
<echo message="${check_out_location}" />
<cvs cvsroot="${cvsroot}" command=" -Q checkout -P -d${project_trunk} ${project_repository_root}/${project_trunk} " dest="${check_out_location}" compression="true" />
<echo message="...check out from CVS done" />
</target>
<target name="strip-settings" depends="checkout" description="Remove elements from the Settings.bundle that we don't want in the distribution">
<echo message="Removing Settings not valid for distribution"/>
<exec executable="/usr/libexec/PlistBuddy" failonerror="TRUE" dir="${app_src}/Resources">
<arg value="-c"/>
<arg value="Delete :PreferenceSpecifiers:3"/>
<arg value="Settings.bundle/Root.plist"/>
</exec>
<exec executable="/usr/libexec/PlistBuddy" failonerror="TRUE" dir="${app_src}/Resources">
<arg value="-c"/>
<arg value="Delete :PreferenceSpecifiers:3"/>
<arg value="Settings.bundle/Root.plist"/>
</exec>
</target>
<target name="build-version" depends="checkout">
<property name = "LOGLEVEL" value = "DEBUG" />
<!-- GET THE NEXT VERSION NUMBER (major and minor) -->
<exec executable="/tmp/build/trunk/Build/version.sh" failonerror="TRUE" outputproperty="version.number" dir="${app_src}"></exec>
<echo message="Increment Build Number"/>
<exec executable="agvtool" failonerror="TRUE" dir="${app_src}">
<arg value="new-version"/>
<arg value="-all"/>
<arg value="${version.number}"/>
</exec>
<!-- GET THE MINOR portion of the version number for later use -->
<exec executable="/tmp/build/trunk/Build/minor.sh" failonerror="TRUE" outputproperty="version.minor" dir="${app_src}"></exec>
<!-- SET the version number as reference in the Settings.bundle -->
<exec executable="/usr/libexec/PlistBuddy" failonerror="TRUE" dir="${app_src}">
<arg value="-c"/>
<arg value="Set :PreferenceSpecifiers:1:DefaultValue ${version.number}"/>
<arg value="./Resources/Settings.bundle/Root.plist"/>
</exec>
<echo message="New build number=${version.number}"/>
<!-- SET the log level - NOTE, ANT vars are immutable, if LOGLEVEL was previously set, it cannot be overridden -->
<exec executable="/usr/libexec/PlistBuddy" failonerror="TRUE" dir="${app_src}">
<arg value="-c"/>
<arg value="Set LogLevel.Default ${LOGLEVEL}"/>
<arg value="./Resources/SharedConfig.plist"/>
</exec>
<echo message="Log level set to ${LOGLEVEL}"/>
</target>
<target name="encrypt" depends="build-version">
<!-- SOME ENCRYPTION OF SENSITIVE DATA -->
</target>
<target name="build-internal" depends="test-lib1, test-lib2, test-app, encrypt">
<echo>Running XCODE compiler</echo>
<exec executable="${xcode_builder}" failonerror="true" vmlauncher="false" dir="${app_src}">
<arg value="clean"/>
<arg value="install"/>
<arg value="-target" />
<arg value="MyApp" />
<arg value="-configuration"/>
<arg value="${CONFIGURATION_INTERNAL}"/>
<arg value="SYMROOT=${build_release}" />
<env key="USER_HEADER_SEARCH_PATHS" value="/tmp/build/trunk/Libraries/somesource/**\ /tmp/build/trunk/Libraries/someothersource/**"/>
</exec>
<echo>xcode build complete</echo>
</target>
<target name="test-lib1" depends="checkout">
<echo>Running XCODE compiler</echo>
<exec executable="${xcode_builder}" failonerror="true" vmlauncher="false" dir="${somelib_dir}">
<arg value="clean"/>
<arg value="build"/>
<arg value="-target" />
<arg value="Lib1UnitTests"/>
<arg value="-sdk"/>
<arg value="iphonesimulator4.1"/>
<arg value="SYMROOT=${build_release}" />
</exec>
<echo>xcode build complete</echo>
</target>
<target name="test-lib2" depends="checkout">
<echo>Running XCODE compiler</echo>
<exec executable="${xcode_builder}" failonerror="true" vmlauncher="false" dir="${somelib2_src_dir}">
<arg value="clean"/>
<arg value="build"/>
<arg value="-target" />
<arg value="Lib2UnitTests"/>
<arg value="-sdk"/>
<arg value="iphonesimulator4.1"/>
<arg value="SYMROOT=${build_release}" />
<env key="USER_HEADER_SEARCH_PATHS" value="/tmp/build/trunk/Libraries/Lib1source/**"/>
</exec>
<echo>xcode build complete</echo>
</target>
<target name="test-app" depends="checkout">
<echo>Running XCODE compiler</echo>
<exec executable="${xcode_builder}" failonerror="true" vmlauncher="false" dir="${app_src}">
<arg value="clean"/>
<arg value="build"/>
<arg value="-target" />
<arg value="AppUnitTests"/>
<arg value="-sdk"/>
<arg value="iphonesimulator4.1"/>
<arg value="SYMROOT=${build_release}" />
<env key="USER_HEADER_SEARCH_PATHS" value="/tmp/build/trunk/Libraries/Lib1/**\ /tmp/build/trunk/Libraries/Lib2/**"/>
</exec>
<echo>xcode build complete</echo>
</target>
<target name="build-distribution" depends="internal-release, test-lib1, test-lib2, test-app">
<echo>Running XCODE compiler</echo>
<exec executable="${xcode_builder}" failonerror="true" vmlauncher="false" dir="${app_src}">
<arg value="build"/>
<arg value="-target" />
<arg value="MyApp" />
<arg value="-configuration"/>
<arg value="${CONFIGURATION_DISTRIBUTION}"/>
<arg value="SYMROOT=${export_app}-${version.number}/Distribution" />
<env key="USER_HEADER_SEARCH_PATHS" value="/tmp/build/trunk/Libraries/Lib1/**\ /tmp/build/trunk/Libraries/Lib2/**"/>
</exec>
<echo>xcode build complete</echo>
</target>
<target name="build-adhoc" depends="internal-release, test-lib1, test-lib2, test-app">
<echo>Running XCODE compiler</echo>
<exec executable="${xcode_builder}" failonerror="true" vmlauncher="false" dir="${app_src}">
<arg value="build"/>
<arg value="-target" />
<arg value="MyApp" />
<arg value="-configuration"/>
<arg value="${CONFIGURATION_ADHOC}"/>
<arg value="SYMROOT=${export_app}-${version.number}/AdHoc" />
<env key="USER_HEADER_SEARCH_PATHS" value="/tmp/build/trunk/Libraries/Lib1/**\ /tmp/build/trunk/Libraries/Lib2/**"/>
</exec>
<echo>xcode build complete</echo>
</target>
<target name="checkin" depends="build-internal" description="Commit source to CVS" >
<echo message="Committing to CVS ...." />
<echo message="${check_out_location}" />
<cvs cvsroot="${cvsroot}" command="commit -m 'Commit of internal release build ${version.number}' MyApp-Info.plist" dest="${check_out_location}/trunk/Applications/MyApp" />
<echo message="...commit done" />
</target>
<target name="tag-release" depends="checkin" description="Tag source in CVS" >
<echo message="Tagging source ... Release-${version.minor}" />
<echo message="${check_out_location}" />
<cvs cvsroot="${cvsroot}" command="tag Release-${version.minor}" dest="${check_out_location}"/>
<echo message="...tag done" />
</target>
<target name="internal-release" depends="tag-release" description="Tag source in CVS" >
<echo message="Creating Internal release ..." />
<echo message="Deploying files to . . .${export_app}" />
<copy todir="${export_app}-${version.number}">
<fileset dir="${prod_dir_internal}"/>
</copy>
<echo message="Internal release ${version.number} complete." />
</target>
<target name="override-default-env" description="Setup Env for Distribution" >
<property name = "LOGLEVEL" value = "WARN" />
</target>
<target name="distribution" depends="override-default-env, strip-settings, build-distribution" description="Create Distribution" >
<echo message="Creating Distribution ..." />
<echo message="Deploying files to . . .${export_app}-${version.number}/Distribution" />
<echo message="Distribution ${version.number} complete." />
</target>
<target name="adhoc" depends="override-default-env, strip-settings, build-adhoc" description="Create Ad Hoc Distribution" >
<echo message="Creating ad hoc distribution ..." />
<echo message="Deploying files to . . .${export_app}-${version.number}/AdHoc" />
<echo message="Ad hoc distribution ${version.number} complete." />
</target>
</project>
Hope this helps.