Eclipse Ant task p2.composite.repository not honoring append=false - eclipse

I'm using the docs at
http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_repositorytasks.htm
I'm trying to setup a build file like this
<?xml version="1.0" encoding="UTF-8"?><project name="osgi.composite.p2">
<target name="osgi.composite.p2">
<p2.composite.repository>
<repository append="false" location="/d01/osgi/DS_5000_10_0_0" name="DS_5000_10_0_0 Composite"/>
<add>
<repository location="DS_5000_10_0_0.HEAD.1308021100.8500"/>
<repository location="thirdparty"/>
<repository location="e4"/>
<repository location="../nebula/"/>
<repository location="../integration/FUSION_DS_5000_8_3_0_SSO/"/>
</add>
</p2.composite.repository>
</target>
</project>
to overwrite the P2 composite index by running
/d01/sandboxes/baron/eclipse/4.3/eclipse -nosplash -application org.eclipse.ant.core.antRunner -buildfile composite.p2-8500.xml osgi.composite.p2
And instead of creating a new composite index it's appending the new entries listed in the build file to the compositeContent.jar, but properly replacing the entries in the compositeArtifacts.jar.

Related

"Missing requirements" when defining an Eclipse target platform with RAP and Teneo

I created a target file and added the RAP target platform and a local folder with some proprietary bundles. When I tried to add the other dependencies for Teneo and Hibernate as stated in this tutorial, some dependencies for Teneo are not satisfied.
This is my target definition file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="server.platform" sequenceNumber="222">
<locations>
<location path="<My_bundles_dir>" type="Directory"/>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.rap.examples.feature.feature.group" version="2.3.0.20140602-1108"/>
<unit id="org.eclipse.rap.feature.feature.group" version="2.3.0.20140610-0925"/>
<unit id="org.eclipse.rap.sdk.feature.feature.group" version="2.3.0.20140610-0925"/>
<unit id="org.eclipse.rap.equinox.target.feature.feature.group" version="2.3.0.20140608-1653"/>
<repository location="http://download.eclipse.org/rt/rap/2.3/R-20140610-0925/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.hibernate.feature.group" version="4.1.1.201310261216"/>
<unit id="org.hsqldb.feature.group" version="2.2.8.201310261216"/>
<unit id="com.db4o.feature.group" version="7.4.155.v20120928-1733"/>
<unit id="org.apache.log4j.feature.group" version="1.2.16.201310261216"/>
<unit id="org.dom4j.feature.group" version="1.6.1.201310261216"/>
<unit id="org.apache.commons.logging.feature.group" version="1.1.1.201310261216"/>
<unit id="org.postgresql.feature.group" version="9.0.0.201310261216"/>
<unit id="com.mysql.jdbc.feature.group" version="5.1.11.201310261216"/>
<unit id="javax.persistence.feature.group" version="2.0.1.201310261216"/>
<unit id="com.microsoft.sqlserver.jdbc.feature.group" version="3.0.1301.201310261216"/>
<repository location="http://www.elver.org/eclipse/2.0.0/update"/>
</location>
</locations>
</target>
I'm getting the following error:
Missing requirement: EMF Common UI 2.9.0.v20140519-0339 (org.eclipse.emf.common.ui.feature.group 2.9.0.v20140519-0339) requires 'org.eclipse.ui 0.0.0' but it could not be found
... requires 'org.eclipse.ui 0.0.0' but it could not be found
The problem with your target definition is that you don't specify any p2 repository that contains this dependency. So you e.g. need to add Luna release train repository: http://download.eclipse.org/releases/luna
The PDE editor is not particularly helpful when it comes to adding p2 repositories which are only needed for dependencies. But you can resort to using a text editor to modify the target file. Here is what you need to do to add a p2 repository for adding dependencies:
Copy one of the location lines with type="InstallableUnit" and paste it below the last closing location tag (</location>).
Add the repository, e.g. with
<repository location="http://download.eclipse.org/releases/luna"/>
Add a closing repository tag.
Increment the sequenceNumber attribute in the root element.
Save the file and open it with the Target Definition Editor again. Dependencies to artifacts in the newly added repository can now be resolved.

Ant Builder for SASS in Zend Studio (Eclipse) "Is A Directory" Error

The build script I am using:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="sass">
<target name="sass">
<apply dest="./sass" executable="sassy.bat">
<srcfile />
<targetfile />
<mapper from="*.scss" to="*.css" type="glob"/>
<fileset dir="./sass" includes="**/*.scss" />
</apply>
</target>
</project>
And it works great, with the condition that I have this external sassy.bat script on my %%PATH%%.
sass %1 %2
It compiles sass/*.scss files and puts the *.css in the same directory. However, if I don't use my sassy.bat and rather just use sass.bat it produces:
ruby.exe: Is a directory -- C:/project/sass (LoadError)
But in theory it should be running the same thing. Any idea what I'm doing wrong?
I ended up solving this problem recently. The first step is to ensure that the builder is set to use a "Separate JRE" (Zend Studio's). The second step was to update my buildfile to the following:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="sass">
<target name="sass">
<exec osfamily="windows" vmlauncher="false" executable="sass">
<arg value="--update" />
<arg value="scss/:css/" />
<arg value="--style=compressed" />
</exec>
</target>
</project>
The key was to set the vmlauncher attribute to false on Windows.

How to build and deploy adapter with single ANT script Worklight 6.1

At 6.1 the ant jar was split into two jars: worklight-ant-builder.jar and worklight-ant-deployer.jar. I can run the build or the deploy tasks by themselves but I have to change the fileset. I want to run the build adapter and deploy adapter out of a single ant script.
I've tried a few ways to include both jars in the taskdef fileset:
include name="*.jar"
or
filename name="*.jar"
or
include name="worklight-ant-builder.jar"
include name="worklight-ant-deployer.jar"
Its almost like the tasks won't accept multiple jars. The build always works, but the deploy only when the deployer.jar is "include name="worklight-ant-deployer.jar" by itself.
<taskdef resource="com/worklight/ant/defaults.properties">
<classpath>
<fileset dir="${worklight.server.install.dir}/WorklightServer">
<include name="*.jar"/>
<!-- <filename name="*.jar"/> -->
<!-- <include name="worklight-ant-builder.jar"/> -->
<!-- <include name="worklight-ant-deployer.jar"/> -->
</fileset>
</classpath>
</taskdef>
I understand the multi-script answer but I think I shouldn't have to do that. This is my full script:
<?xml version="1.0" encoding="UTF-8"?>
<project name="BuildDeployAdapter" basedir="." default="help">
<property name="worklight.server.install.dir" value="C:/IBM/Worklight61/"/>
<property name="adapter-source-files-folder" value="C:/Worklight/workspaces/base61p/HelloWorklight/adapters/HTTPAdapter"/>
<property name="destination-folder" value="C:/Worklight/workspaces/base61p/HelloWorklight/binANT"/>
<property name="myAdapter.adapter" value="${destination-folder}/HTTPAdapter.adapter"/>
<property name="http.server.port.context" value="http://mydomain:9080/worklight"/>
<taskdef resource="com/worklight/ant/defaults.properties">
<classpath>
<fileset dir="${worklight.server.install.dir}/WorklightServer">
<include name="*.jar"/>
<!-- <filename name="*.jar"/> -->
<!-- <include name="worklight-ant-builder.jar"/> -->
<!-- <include name="worklight-ant-deployer.jar"/> -->
</fileset>
</classpath>
</taskdef>
<target name="buildAdapter">
<adapter-builder
folder="${adapter-source-files-folder}"
destinationfolder="${destination-folder}"/>
</target>
<target name="deployAdapter">
<adapter-deployer deployable="${myAdapter.adapter}"
worklightserverhost="${http.server.port.context}"
userName="username" password="password" />
</target>
</project>
Right now I have to switch the included jar for each task, when I want to use the masked include - either include name=".jar" or filename name=".jar". This seems to be a limititation on the specific task not accepting more than one jar. Am I off base here?
Given the information you provided, it seems that a solution could be to create a separate script that would invoke the build and deploy scripts in sequence, like this:
<project name="Adapter Stuff" default="do.all" basedir=".">
<target name="do.all">
<ant antfile="path/to/worklight-build-adapter.xml"
target="build-target" inheritall="false"/>
<ant antfile="path/to/worklight-deploy-adapter.xml"
target="deploy-target" inheritall="false"/>
</target>
</project>

Ant buildfile does not contain a javac task

I have build.xml file and I want to create Java project from Existing Ant Buildfile. But I have an error: Specified buildfile does not contain a javac task
My file has simple structure:
<project>
<target ...>
</target>
...
</project>
Provide javac to your build.xml as below:
<javac srcdir="src" destdir="bin" />
As Puneet Pandey pointed out, this error occurs when your build.xml file is lacking a <javac> XML element.
The <javac> XML element in the build.xml file (referred to as javac task) tells the compiler or IDE (Eclipse in this case) where the source Java files are for compiling. Once you know that it should be quite clear why Eclipse can't import your build.xml without a <javac> XML element.
In case you are not sure where to stick the <javac> tag I'll add a slightly fuller example. You will need to navigate to your build.xml and edit it so that it contains the <javac> line in the appropriate section inside the <project> tag.
<project ...>
<javac srcdir="src" destdir="bin" />
<target ...>
</target>
...
</project>
You need something like this,
<target name="compile">
<javac destdir="build/classes" srcdir="src" includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="war" depends="compile">
<war destfile="build/${name}.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="WebContent" casesensitive="no">
</fileset>
<lib dir="WebContent/WEB-INF/lib"/>
<classes dir="build/classes">
</classes>
</war>
</target>

Which feature to include for bundle org.junit

I'm refactoring my RCP app, and I'm going to use tycho as building system.
In the process, I had to rewrite my target platform so to depend on online repositories. Currently, my target is something like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.6"?>
<target name="MyRcpApp" sequenceNumber="12">
<locations>
<location includeAllPlatforms="false" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.rcp.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0" />
<repository location="http://download.eclipse.org/releases/indigo/"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
</target>
However, this target does not provide the bundle for junit tests (org.junit)... hence my eclipse has a lot of errors (due to the missing junit) and my build fails.
Does somebody know which unit should I include? (or, better, how can I get the list of all the unit available at a given repository?)
you will need the JDT feature (unfortunately there is no smaller feature I know of which includes junit)
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
Another option is to include single bundle IUs (the .target file format supports this but the target editor UI does not). In this case you need to make sure that transitive dependencies are also added. Try adding
<unit id="org.junit" version="0.0.0"/>
<unit id="org.hamcrest.core" version="0.0.0"/>