Skip to content
Snippets Groups Projects
Commit 78ec5970 authored by david_williams's avatar david_williams
Browse files

tiny utility to aid getting feature versions

parent 001c82d3
No related branches found
No related tags found
No related merge requests found
package org.eclipse.wtp.releng.tools;
import java.io.File;
public class UpdateFeatureUpdateFile {
private String featuresDirectoryLocation = "\\builds\\temp\\wtp-sdk-S-2.0RC2-200706050057\\eclipse\\features";
private String featureUpdateFileLocation;
private FullJarNameParser fullJarNameParser = new FullJarNameParser();
private String[] featuresOfInterest = new String[]{"org.eclipse.wst", "org.eclipse.jst", "org.eclipse.jst.jsf.feature", "org.eclipse.jpt.feature", "org.eclipse.wst.sdk", "org.eclipse.jst.sdk", "org.eclipse.jst.jsf_sdk.feature", "org.eclipse.jpt_sdk.feature", };//"org.eclipse.wst.xml_ui.feature", "org.eclipse.wst.xml_sdk.feature",};
private String[] shortListOfInterest = new String[]{"org.eclipse.wst", "org.eclipse.jst", "org.eclipse.jst.jsf.feature", "org.eclipse.jpt.feature", }; //"org.eclipse.wst.xml_ui.feature",};
public static void main(String[] args) {
new UpdateFeatureUpdateFile().getFeatureDirectories();
}
private void getFeatureDirectories() {
System.out.println("featuresDirectoryLocation: " + getFeaturesDirectoryLocation());
// System.out.println("featureUpdateFileLocation: " +
// getFeatureUpdateFileLocation());
File featureDirectory = new File(featuresDirectoryLocation);
String[] featureDirectories = featureDirectory.list();
System.out.println("Full List for main WTP site");
System.out.println();
doList(featureDirectories, featuresOfInterest);
System.out.println();
System.out.println("Short List for Europa site");
System.out.println();
doList(featureDirectories, shortListOfInterest);
}
private void doList(String[] featureDirectories, String[] featureOfFocus) {
for (int i = 0; i < featureDirectories.length; i++) {
String directoryName = featureDirectories[i];
fullJarNameParser.parse(directoryName);
String projectName = fullJarNameParser.getProjectString();
String versionString = fullJarNameParser.getVersionString();
if (contains(projectName, featureOfFocus)) {
System.out.println(" <ant antfile=\"updateMirrorProject.xml\">\r\n" + " <property\r\n" + " name=\"featureId\"\r\n" + " value=\"" + projectName + "\" />\r\n" + " <property\r\n" + " name=\"version\"\r\n" + " value=\"" + versionString + "\" />\r\n" + " </ant>");
}
}
}
public String getFeaturesDirectoryLocation() {
return featuresDirectoryLocation;
}
public void setFeaturesDirectoryLocation(String featuresDirectoryLocation) {
this.featuresDirectoryLocation = featuresDirectoryLocation;
}
public String getFeatureUpdateFileLocation() {
return featureUpdateFileLocation;
}
public void setFeatureUpdateFileLocation(String featureUpdateFileLocation) {
this.featureUpdateFileLocation = featureUpdateFileLocation;
}
private boolean contains(String needle, String[] haystack) {
boolean result = false;
for (int i = 0; i < haystack.length; i++) {
if (needle.equals(haystack[i])) {
result = true;
break;
}
}
return result;
}
}
org.eclipse.wst
org.eclipse.jst
org.eclipse.jst.jsf.feature
org.eclipse.jpt.feature
org.eclipse.wst.sdk
org.eclipse.jst.sdk
org.eclipse.jst.jsf_sdk.feature
org.eclipse.jpt_sdk.feature
org.eclipse.wst.xml_sdk.feature
org.eclipse.wst.xml_ui.feature
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment