---
title: "rcp ant build "
author: "xmind"
date: "2014-08-15T14:07:56Z"
tags: []
categories: ["互联网"]
slug: "rcp-ant-build"
draft: false
lastmod: "2014-08-15T14:09:16Z"
id: 2104323
url: "https://xmind.iteye.com/blog/2104323"
---

1. 1. 1. 需要的东东：
      
      <!--THE END-->
      
      - Eclipse（4.4）： http://yunpan.cn/Qau2Eyni43pfM  访问密码 37a0
      - 测试项目：tstRcpAutoBuild：http://yunpan.cn/Qau8mVuvvVtpr  访问密码 90a5
      - 需要的插件：eclipse-4.4-delta-pack：http://yunpan.cn/Qau8FTTYLKfmQ  访问密码 af79
      - java1.8: http://yunpan.cn/QauEcfhXg5mnw  访问密码 1dc5
   2. 目录结构：
      
       Java Code 
      
      1  
      2  
      3  
      4  
      5
      
       
      
      F:\\  
      |- rcp\_study  
         |- eclipse  
         |- export  
         |- workspace
   3. 测试步骤：
      
      - 下载上面的3个东东；
      - 向上面建立目录结构：
      - 将delta-pack解压到Eclipse目录下。
      - 启动Eclipse，选择workspace：F:\\rcp\_study\\workspace
      - 导入下载的测试项目，拷贝到当前workspace。
      - 在Eclipse找到文件F:\\rcp\_study\\workspace\\tstRcpAutoBuild\\automake\\build.xml，右键运行Ant Build.
      - 运行完了：F:\\rcp\_study\\export\\tstRcp就可以找到你打包好的RCP。
   4. 测试完毕
   5. 详细可以不看，写写：主要准备了两个文件F:\\rcp\_study\\workspace\\tstRcpAutoBuild\\automake\\buildConfiguration\\build.properties 和 F:\\rcp\_study\\workspace\\tstRcpAutoBuild\\automake\\build.xml
      
      1. build.xml
         
          Java Code 
         
         1  
         2  
         3  
         4  
         5  
         6  
         7  
         8  
         9  
         10  
         11  
         12  
         13  
         14  
         15  
         16  
         17  
         18  
         19  
         20  
         21  
         22  
         23  
         24  
         25  
         26  
         27  
         28  
         29  
         30  
         31  
         32  
         33  
         34  
         35  
         36  
         37  
         38  
         39  
         40  
         41  
         42  
         43  
         44  
         45  
         46  
         47
         
          
         
         &lt;?xml version="1.0" encoding="UTF-8"?&gt;   
         &lt;project name="project" default="unzip"&gt;  
               
             &lt;!-- define variable --&gt;  
             &lt;property name="project.dir" value="F:/rcp\_study/workspace"/&gt;  
             &lt;property name="dist.dir" value="F:/rcp\_study/export/autobuild\_tmp\_dir/plugins"/&gt;  
             &lt;property name="buildConfiguration" value="F:/rcp\_study/workspace/tstRcpAutoBuild/automake/buildConfiguration"/&gt;
         
             &lt;property name="eclipse.install" value="F:/rcp\_study/eclipse"/&gt;  
             &lt;property name="productBuild.xml" value="${eclipse.install}/plugins/org.eclipse.pde.build\_3.9.0.v20140415-2029/scripts/productBuild/productBuild.xml"/&gt;  
             &lt;property name="launcher.jar" value="${eclipse.install}/plugins/org.eclipse.equinox.launcher\_1.3.0.v20140415-2008.jar"/&gt;  
               
             &lt;!-- target prepare --&gt;  
             &lt;target name="prepare"&gt;  
                 &lt;mkdir dir="${dist.dir}"/&gt;  
                 &lt;copy todir="${dist.dir}"&gt;  
                     &lt;fileset dir="${project.dir}" includes="\*\*"&gt;  
                     &lt;/fileset&gt;  
                 &lt;/copy&gt;  
             &lt;/target&gt;  
               
             &lt;!-- target rcpAutomatedBuild --&gt;  
             &lt;target name="rcpAutomatedBuild" depends="prepare"&gt;  
                 &lt;java classname="org.eclipse.core.launcher.Main" fork="true" failonerror="true"&gt;  
                     &lt;arg value="-application"/&gt;  
                     &lt;arg value="org.eclipse.ant.core.antRunner"/&gt;  
                     &lt;arg value="-buildfile"/&gt;  
                     &lt;arg value="${productBuild.xml}"/&gt;  
                     &lt;arg value="-Dbuilder=${buildConfiguration}"/&gt;  
                     &lt;arg value="-DbaseLocation=${eclipse.install}"/&gt;  
                     &lt;!--arg value="-v"/--&gt;  
                     &lt;classpath&gt;  
                         &lt;pathelement location="${launcher.jar}"/&gt;  
                     &lt;/classpath&gt;  
                 &lt;/java&gt;  
             &lt;/target&gt;  
               
              &lt;target name="unzip" depends="rcpAutomatedBuild"&gt;  
                 &lt;unzip src="${dist.dir}/../I.TestBuild/TestBuild-win32.win32.x86.zip"  
                     dest="F:/rcp\_study/export" /&gt;   
                 &lt;!--arg value="-v"/  
                 &lt;delete dir="${buildConfiguration}../../../../tmp\_gui\_editor" /&gt;  
                 --&gt;  
             &lt;/target&gt;  
               
         &lt;/project&gt;
      2. build.properties
         
          Java Code 
         
         1  
         2  
         3  
         4  
         5  
         6  
         7  
         8  
         9  
         10  
         11  
         12  
         13  
         14  
         15  
         16  
         17  
         18  
         19  
         20  
         21  
         22  
         23  
         24  
         25  
         26  
         27  
         28  
         29  
         30  
         31  
         32  
         33  
         34  
         35  
         36  
         37  
         38  
         39  
         40  
         41  
         42  
         43  
         44  
         45  
         46  
         47  
         48  
         49  
         50  
         51  
         52  
         53  
         54  
         55  
         56  
         57  
         58  
         59  
         60  
         61  
         62  
         63  
         64  
         65  
         66  
         67  
         68  
         69  
         70  
         71  
         72  
         73  
         74  
         75  
         76  
         77  
         78  
         79  
         80  
         81  
         82  
         83  
         84  
         85  
         86  
         87  
         88  
         89  
         90  
         91  
         92  
         93  
         94  
         95  
         96  
         97  
         98  
         99  
         100  
         101  
         102  
         103  
         104  
         105  
         106  
         107  
         108  
         109  
         110  
         111  
         112  
         113  
         114  
         115  
         116  
         117  
         118  
         119  
         120  
         121  
         122  
         123  
         124  
         125  
         126  
         127  
         128  
         129  
         130  
         131  
         132  
         133  
         134  
         135  
         136  
         137  
         138  
         139  
         140  
         141  
         142  
         143  
         144  
         145  
         146  
         147  
         148  
         149  
         150  
         151  
         152  
         153  
         154  
         155  
         156  
         157  
         158  
         159  
         160  
         161  
         162  
         163  
         164  
         165  
         166  
         167  
         168  
         169  
         170  
         171  
         172  
         173  
         174  
         175  
         176  
         177  
         178  
         179  
         180  
         181  
         182  
         183  
         184  
         185  
         186  
         187  
         188  
         189  
         190  
         191  
         192  
         193  
         194  
         195  
         196  
         197  
         198  
         199  
         200  
         201  
         202  
         203  
         204  
         205  
         206  
         207  
         208  
         209  
         210  
         211  
         212  
         213  
         214  
         215  
         216  
         217  
         218  
         219  
         220  
         221  
         222  
         223  
         224  
         225  
         226  
         227  
         228  
         229  
         230  
         231  
         232  
         233  
         234  
         235  
         236  
         237  
         238  
         239  
         240  
         241  
         242  
         243  
         244  
         245  
         246  
         247  
         248  
         249  
         250  
         251  
         252  
         253  
         254  
         255  
         256  
         257
         
          
         
         ###############################################################################  
         # Copyright (c) 2003, 2006 IBM Corporation and others.  
         # All rights reserved. This program and the accompanying materials  
         # are made available under the terms of the Eclipse Public License v1.0  
         # which accompanies this distribution, and is available at  
         # http://www.eclipse.org/legal/epl-v10.html  
         #   
         # Contributors:  
         #     IBM Corporation - initial API and implementation  
         ###############################################################################  
         #####################  
         # Parameters describing how and where to execute the build.  
         # Typical users need only update the following properties:  
         #    baseLocation - where things you are building against are installed  
         #    bootclasspath - The base jars to compile against (typicaly rt.jar)  
         #    configs - the list of {os, ws, arch} configurations to build.    
         \#  
         # Of course any of the settings here can be overridden by spec'ing   
         # them on the command line (e.g., -DbaseLocation=d:/eclipse
         
         #The type of the top level element we are building,  generally "feature"  
         topLevelElementType = feature  
         #The id of the top level element we are building  
         topLevelElementId = org.foo.bar
         
         ############# PRODUCT/PACKAGING CONTROL #############  
         product=F:/rcp\_study/workspace/tstRcpAutoBuild/automake/tstRcp.product  
         runPackager=true
         
         #Set the name of the archive that will result from the product build.  
         #archiveNamePrefix=
         
         # The prefix that will be used in the generated archive.  
         archivePrefix=tstRcp
         
         # The location underwhich all of the build output will be collected.  
         collectingFolder=${archivePrefix}
         
         # The list of {os, ws, arch} configurations to build.  This   
         # value is a '&' separated list of ',' separate triples.  For example,   
         #     configs=win32,win32,x86 & linux,motif,x86  
         # By default the value is \*,\*,*  
         #configs = \*, \*, *  
         configs = win32, win32, x86  
         #configs=win32, win32, x86 & \\  
         #   win32,win32,x86\_64 & \\  
         #   win32,win32,wpf & \\  
         #   linux, gtk, ppc & \\  
         #   linux, gtk, x86 & \\  
         #   linux, gtk, x86\_64 & \\  
         #   linux, motif, x86 & \\  
         #   solaris, motif, sparc & \\  
         #   solaris, gtk, sparc & \\  
         #   aix, motif, ppc & \\  
         #   hpux, motif, ia64\_32 & \\  
         #   macosx, carbon, ppc & \\  
         #   macosx, carbon, x86 & \\  
         #   macosx, cocoa, ppc & \\  
         #   macosx, cocoa, x86 & \\  
         #   macosx, cocoa, x86\_64
         
         # By default PDE creates one archive (result) per entry listed in the configs property.  
         # Setting this value to true will cause PDE to only create one output containing all   
         # artifacts for all the platforms listed in the configs property.  
         # To control the output format for the group, add a "group, group, group - &lt;format&gt;" entry to the  
         # archivesFormat.   
         #groupConfigurations=true
         
         #The format of the archive. By default a zip is created using antZip.  
         #The list can only contain the configuration for which the desired format is different than zip.  
         #archivesFormat=win32, win32, x86 - antZip& \\  
         #   linux, gtk, ppc - antZip &\\  
         #    linux, gtk, x86 - antZip& \\  
         #   linux, gtk, x86\_64 - antZip& \\  
         # linux, motif, x86 - antZip& \\  
         #   solaris, motif, sparc - antZip& \\  
         #   solaris, gtk, sparc - antZip& \\  
         #   aix, motif, ppc - antZip& \\  
         #   hpux, motif, PA\_RISC - antZip& \\  
         #   macosx, carbon, ppc - antZip
         
         #Allow cycles involving at most one bundle that needs to be compiled with the rest being binary bundles.  
         allowBinaryCycles = true
         
         #Sort bundles depenedencies across all features instead of just within a given feature.  
         #flattenDependencies = true
         
         #Parallel compilation, requires flattenedDependencies=true  
         #parallelCompilation=true  
         #parallelThreadCount=  
         #parallelThreadsPerProcessor=  
               
         #Set to true if you want the output to be ready for an update jar (no site.xml generated)  
         #outputUpdateJars = false
         
         #Set to true for Jnlp generation  
         #codebase should be a URL that will be used as the root of all relative URLs in the output.  
         #generateJnlp=false  
         #jnlp.codebase=&lt;codebase url&gt;  
         #jnlp.j2se=&lt;j2se version&gt;  
         #jnlp.locale=&lt;a locale&gt;  
         #jnlp.generateOfflineAllowed=true or false generate &lt;offlineAllowed/&gt; attribute in the generated features  
         #jnlp.configs=${configs}            #uncomment to filter the content of the generated jnlp files based on the configuration being built
         
         #Set to true if you want to sign jars  
         #signJars=false  
         #sign.alias=&lt;alias&gt;  
         #sign.keystore=&lt;keystore location&gt;  
         #sign.storepass=&lt;keystore password&gt;  
         #sign.keypass=&lt;key password&gt;
         
         #Arguments to send to the zip executable  
         zipargs=
         
         #Arguments to send to the tar executable  
         tarargs=
         
         #Control the creation of a file containing the version included in each configuration - on by default   
         #generateVersionsLists=false
         
         ############## BUILD NAMING CONTROL ################  
         # The directory into which the build elements are fetched and where  
         # the build takes place.  
         buildDirectory=F:/rcp\_study/export/autobuild\_tmp\_dir
         
         # Type of build.  Used in naming the build output.  Typically this value is  
         # one of I, N, M, S, ...  
         buildType=I
         
         # ID of the build.  Used in naming the build output.  
         buildId=TestBuild
         
         # Label for the build.  Used in naming the build output  
         buildLabel=${buildType}.${buildId}
         
         # Timestamp for the build.  Used in naming the build output  
         timestamp=007
         
         #The value to be used for the qualifier of a plugin or feature when you want to override the value computed by pde.  
         #The value will only be applied to plugin or features indicating build.properties, qualifier = context   
         #forceContextQualifier=&lt;the value for the qualifier&gt;
         
         #Enable / disable the generation of a suffix for the features that use .qualifier.   
         #The generated suffix is computed according to the content of the feature     
         #generateFeatureVersionSuffix=true
         
         ############# BASE CONTROL #############  
         # Settings for the base Eclipse components and Java class libraries   
         # against which you are building.  
         # Base location for anything the build needs to compile against.  For example,  
         # in most RCP app or a plug-in,  the baseLocation should be the location of a previously  
         # installed Eclipse against which the application or plug-in code will be compiled and the RCP delta pack.
         
         base=&lt;F:/rcp\_study/eclipse&gt;  
         baseLocation=${base}/eclipse
         
         #Folder containing repositories whose content is needed to compile against  
         #repoBaseLocation=${base}/repos  
         #Folder where the content of the repositories from ${repoBaseLocation} will be made available as a form suitable to be compiled against  
         #transformedRepoLocation=${base}/transformedRepos
         
         #Os/Ws/Arch/nl of the eclipse specified by baseLocation  
         baseos=win32  
         basews=win32  
         basearch=x86
         
         #this property indicates whether you want the set of plug-ins and features to be considered during the build to be limited to the ones reachable from the features / plugins being built  
         filteredDependencyCheck=false
         
         #this property indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons)  
         resolution.devMode=false
         
         #pluginPath is a list of locations in which to find plugins and features.  This list is separated by the platform file separator (; or :)  
         #a location is one of:    
         #- the location of the jar or folder that is the plugin or feature : /path/to/foo.jar or /path/to/foo  
         #- a directory that contains a /plugins or /features subdirectory  
         #- the location of a feature.xml, or for 2.1 style plugins, the plugin.xml or fragment.xml  
         #pluginPath=
         
         skipBase=true  
         eclipseURL=&lt;url for eclipse download site&gt;  
         eclipseBuildId=&lt;Id of Eclipse build to get&gt;  
         eclipseBaseURL=${eclipseURL}/eclipse-platform-${eclipseBuildId}-win32.zip
         
         ############# MAP FILE CONTROL ################  
         # This section defines CVS tags to use when fetching the map files from the repository.  
         # If you want to fetch the map file from repository / location, change the getMapFiles target in the customTargets.xml
         
         skipMaps=true  
         mapsRepo=:pserver:anonymous@example.com/path/to/repo  
         mapsRoot=path/to/maps  
         mapsCheckoutTag=HEAD
         
         #tagMaps=true  
         mapsTagTag=v${buildId}
         
         ############ REPOSITORY CONTROL ###############  
         # This section defines properties parameterizing the repositories where plugins, fragments  
         # bundles and features are being obtained from. 
         
         # The tags to use when fetching elements to build.  
         # By default thebuilder will use whatever is in the maps.    
         # This value takes the form of a comma separated list of repository identifier (like used in the map files) and the   
         # overriding value  
         # For example fetchTag=CVS=HEAD, SVN=v20050101  
         # fetchTag=HEAD  
         skipFetch=true
         
         ############# JAVA COMPILER OPTIONS ##############  
         # The location of the Java jars to compile against.  Typically the rt.jar for your JDK/JRE  
         #bootclasspath=${java.home}/lib/rt.jar
         
         # specific JRE locations to compile against. These values are used to compile bundles specifying a   
         # Bundle-RequiredExecutionEnvironment. Uncomment and set values for environments that you support  
         #CDC-1.0/Foundation-1.0= /path/to/rt.jar  
         #CDC-1.1/Foundation-1.1=  
         #OSGi/Minimum-1.0=  
         #OSGi/Minimum-1.1=  
         #JRE-1.1=  
         #J2SE-1.2=  
         #J2SE-1.3=  
         #J2SE-1.4=  
         #J2SE-1.5=  
         #JavaSE-1.6=  
         #PersonalJava-1.1=  
         #PersonalJava-1.2=  
         #CDC-1.0/PersonalBasis-1.0=  
         #CDC-1.0/PersonalJava-1.0=  
         #CDC-1.1/PersonalBasis-1.1=  
         #CDC-1.1/PersonalJava-1.1=
         
         # Specify the output format of the compiler log when eclipse jdt is used  
         logExtension=.log
         
         # Whether or not to include debug info in the output jars  
         javacDebugInfo=false 
         
         # Whether or not to fail the build if there are compiler errors  
         javacFailOnError=true
         
         # Enable or disable verbose mode of the compiler  
         javacVerbose=true
         
         # Extra arguments for the compiler. These are specific to the java compiler being used.  
         #compilerArg=
         
         # Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties  
         javacSource=1.8
         
         # Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties.  
         javacTarget=1.8