Bug 342460 - Run SDK tests against Oracle Java 7 JRE
diff --git a/bundles/org.eclipse.build.tools/bugTools.jar b/bundles/org.eclipse.build.tools/bugTools.jar
deleted file mode 100644
index 1e1f2d6..0000000
--- a/bundles/org.eclipse.build.tools/bugTools.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.build.tools/buildTools.jar b/bundles/org.eclipse.build.tools/buildTools.jar
index e3d63f0..95b5cbe 100644
--- a/bundles/org.eclipse.build.tools/buildTools.jar
+++ b/bundles/org.eclipse.build.tools/buildTools.jar
Binary files differ
diff --git a/bundles/org.eclipse.build.tools/feedTools.jar b/bundles/org.eclipse.build.tools/feedTools.jar
deleted file mode 100644
index e10ea43..0000000
--- a/bundles/org.eclipse.build.tools/feedTools.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.build.tools/plugin.xml b/bundles/org.eclipse.build.tools/plugin.xml
index 29b7f74..e531a2c 100644
--- a/bundles/org.eclipse.build.tools/plugin.xml
+++ b/bundles/org.eclipse.build.tools/plugin.xml
@@ -12,10 +12,7 @@
point="org.eclipse.ant.core.extraClasspathEntries">
<extraClasspathEntry
library="buildTools.jar">
- </extraClasspathEntry>
- <extraClasspathEntry
- library="feedTools.jar">
- </extraClasspathEntry>
+ </extraClasspathEntry>
</extension>
<!-- Tasks -->
<extension point="org.eclipse.ant.core.antTasks">
@@ -58,38 +55,7 @@
library="buildTools.jar"
name="generateExcludeList"
class="org.eclipse.releng.GenerateExcludeListTask">
- </antTask>
+ </antTask>
-
- <!-- <antTask
- library="feedTools.jar"
- name="CreateFeed"
- class="org.eclipse.releng.generators.rss.RSSFeedCreateFeedTask">
- </antTask>
- <antTask
- library="feedTools.jar"
- name="AddEntry"
- class="org.eclipse.releng.generators.rss.RSSFeedAddEntryTask">
- </antTask>
- <antTask
- library="feedTools.jar"
- name="GetProperty"
- class="org.eclipse.releng.generators.rss.RSSFeedGetPropertyTask">
- </antTask>
- <antTask
- library="feedTools.jar"
- name="UpdateEntry"
- class="org.eclipse.releng.generators.rss.RSSFeedUpdateEntryTask">
- </antTask>
- <antTask
- library="feedTools.jar"
- name="PublishFeed"
- class="org.eclipse.releng.services.rss.RSSFeedPublisherTask">
- </antTask>
- <antTask
- library="feedTools.jar"
- name="WatchFeed"
- class="org.eclipse.releng.services.rss.RSSFeedWatcherTask">
- </antTask> -->
</extension>
</plugin>
diff --git a/bundles/org.eclipse.build.tools/scripts_bugzilla/_README.txt b/bundles/org.eclipse.build.tools/scripts_bugzilla/_README.txt
deleted file mode 100644
index 760c397..0000000
--- a/bundles/org.eclipse.build.tools/scripts_bugzilla/_README.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-UpdateBugStateTask is an ant task used for updating the status of 1 or
-more bugs that have been resolved with a particular build of any Eclipse
-project. It can also be used for updating a specified list of bugs which
-are all in a specific state.
-
-Before you can use this tool, you must run the UpdateBugStateTask.sh script
-to generate a Bugzilla login session. This should take less than a minute,
-and is a one time thing (although it is possible that the Bugzilla server
-will clear the stored sessions, in this case simply run the
-UpdateBugStateTask.sh script again).
-
-UpdateBugStateTask requires JDK 1.4 or greater.
-
-See the sample UpdateBugStateTask.xml build script for a full list and
-description of the task options.
diff --git a/bundles/org.eclipse.build.tools/scripts_bugzilla/bugzillaLogin.sh b/bundles/org.eclipse.build.tools/scripts_bugzilla/bugzillaLogin.sh
deleted file mode 100644
index 9edd9f5..0000000
--- a/bundles/org.eclipse.build.tools/scripts_bugzilla/bugzillaLogin.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-
-echo -n "Bugzilla login or email address: "
-read LOGIN
-echo -n "Bugzilla password: "
-stty -echo
-read PW
-stty echo
-echo
-echo "Logging in and fetching cookie values..."
-echo
-
-#older versions of curl (like the one on emf) don't have -k
-OUT=$(curl -k 2>&1| grep unknown)
-if [[ $OUT ]];
-then
- CURLARG=""
-else
- CURLARG="-k"
-fi
-HEADERS=$(mktemp)
-curl -s -S $CURLARG 'https://bugs.eclipse.org/bugs/index.cgi' -d "GoAheadAndLogIn=1&Bugzilla_login=$LOGIN&Bugzilla_password=$PW" -D $HEADERS >/dev/null
-PW="$RANDOM $RANDOM $RANDOM $RANDOM"
-VALUES=$(grep Set-Cookie $HEADERS | sed -e 's/.\{1,\}Bugzilla_\(login\(cookie\)\?=[0-9]\{1,\}\).\{1,\}/\1/')
-rm -fr $HEADERS
-
-if [[ $VALUES ]];
-then
- #alternatively, you can do ./UpdateBugStateTask.sh 2>../properties/UpdateBugStateTask.properties
- echo "Paste the following into UpdateBugStateTask.properties:"
- echo "---- 8< ---- cut here ---- 8< ----"
- echo ""
- if [[ -e /proc/self/fd/2 ]];
- then
- echo "$VALUES" >/proc/self/fd/2
- else
- echo "$VALUES"
- fi
- echo ""
- echo "---- 8< ---- cut here ---- 8< ----"
-else
- echo "Bugzilla didn't send us any cookie values, this means that either:"
- echo " - you mistyped your login/password"
- echo " - you can't reach Bugzilla for some reason"
- echo
- echo "Make sure that you can reach <https://bugs.eclipse.org/bugs/index.cgi> and try again."
-fi
diff --git a/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsJar.sh b/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsJar.sh
deleted file mode 100644
index 0e395b8..0000000
--- a/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsJar.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-export JAVA_HOME=/opt/sun-java2-5.0;
-export ANT_HOME=/opt/apache-ant-1.6;
-$ANT_HOME/bin/ant -f buildBugToolsJar.xml;
diff --git a/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsJar.xml b/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsJar.xml
deleted file mode 100644
index 1d1f63e..0000000
--- a/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsJar.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Build bugTools.jar" default="buildBugToolsJar" basedir="../">
- <target name="buildBugToolsJar">
- <echo message="Compiling bugTools ..."/>
- <delete file="bugTools.jar"/>
- <delete dir="bin/"/>
- <mkdir dir="bin"/>
- <javac
- source="1.4"
- target="1.4"
- srcdir="."
- destdir="bin/"
- classpath="../org.eclipse.releng.basebuilder/plugins/org.apache.ant_1.6.5/lib/ant.jar"
- includes="src_bugzilla/**/*.java, src_bugzilla/**/messages.properties"/>
- <echo message="Jarring bugTools.jar ..."/>
- <jar
- destfile="bugTools.jar"
- includes="**/*.class"
- basedir="bin"
- update="true"/>
- <jar
- destfile="bugTools.jar"
- includes="**/messages.properties"
- basedir="src_bugzilla"
- update="true"/>
- </target>
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsZip.sh b/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsZip.sh
deleted file mode 100644
index 45fe1f9..0000000
--- a/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsZip.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-export JAVA_HOME=/opt/sun-java2-5.0;
-export ANT_HOME=/opt/apache-ant-1.6;
-$ANT_HOME/bin/ant -f buildBugToolsZip.xml;
diff --git a/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsZip.xml b/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsZip.xml
deleted file mode 100644
index 918e2e6..0000000
--- a/bundles/org.eclipse.build.tools/scripts_bugzilla/buildBugToolsZip.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Build bugTools.zip" default="buildBugToolsZip" basedir="../">
- <target name="buildBugToolsZip">
- <property name="zipfile" value="org.eclipse.build.tools_bugTools.zip"/>
- <ant antfile="scripts_bugzilla/buildBugToolsJar.xml" target="buildBugToolsJar" inheritall="true"/>
- <echo message="Bundling ${zipfile} ..."/>
- <delete file="${zipfile}"/>
- <zip
- destfile="${zipfile}"
- includes=".classpath, .project,
- bugTools.jar,
- src_bugzilla/**/*,
- scripts_bugzilla/*,
- properties/UpdateBugStateTask.properties"
- basedir="."
- update="true"/>
- </target>
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_bugzilla/updateBugState.sh b/bundles/org.eclipse.build.tools/scripts_bugzilla/updateBugState.sh
deleted file mode 100644
index e0411f4..0000000
--- a/bundles/org.eclipse.build.tools/scripts_bugzilla/updateBugState.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-export JAVA_HOME=/opt/sun-java2-1.4;
-export ANT_HOME=/opt/apache-ant-1.6;
-
-#aasemble the command and its classpath
-CLASSPATH="$JAVA_HOME/lib/rt.jar";
-# note that com.sun.org.apache.xerces (Sun JDK 1.5, rt.jar) != org.apache.xerces (Ant 1.6.5, xercesImpl.jar) so must remove from classpath
-#for f in `find $ANT_HOME/lib -maxdepth 1 -name "*.jar" -type f -not -name "xercesImpl.jar"`; do CLASSPATH=$CLASSPATH":"$f; done
-CLASSPATH=$CLASSPATH":"$ANT_HOME/lib/ant.jar":"$ANT_HOME/lib/ant-launcher.jar;
-cmd="$JAVA_HOME/bin/java \
- -Dant.home=$ANT_HOME \
- -Dant.library.dir=$JAVA_HOME/lib \
- -classpath $CLASSPATH:../bugTools.jar \
- org.apache.tools.ant.launch.Launcher \
- -buildfile updateBugState.xml";
-
-if [[ $debug -gt 0 ]]; then
- echo "Running ..."; echo ""; echo $cmd | sed -e "s/ \-/# \-/g" -e "s/:/# :/g" | tr "#" "\n"; echo "";
-fi
-
-# run the command
-$cmd;
diff --git a/bundles/org.eclipse.build.tools/scripts_bugzilla/updateBugState.xml b/bundles/org.eclipse.build.tools/scripts_bugzilla/updateBugState.xml
deleted file mode 100644
index b26b905..0000000
--- a/bundles/org.eclipse.build.tools/scripts_bugzilla/updateBugState.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Update Bug State" default="updateBugState">
-
- <taskdef name="UpdateBugState"
- classname="org.eclipse.releng.services.bugzilla.UpdateBugStateTask"
- classpath="../bugTools.jar"/>
-
- <!-- 1. Define property file -->
- <target name="init">
- <property file="../properties/UpdateBugStateTask.properties"/>
- </target>
-
- <!-- 2. Update Bugzilla state for specific criteria -->
- <target name="updateBugState" depends="init" description="Update Bugzilla state for specific criteria">
- <!--
- UpdateBugStateTask takes a few parameters, some are required and some are optional, see below.
- milestone, product and resolution correspond to the Bugzilla items of the same name
-
- login - required, your userid for Bugzilla (can be generated by UpdateBugStateTask.sh)
-
- logincookie - required, your logincookie for Bugzilla (can be generated by UpdateBugStateTask.sh)
-
- status - required, only query for bugs in this state
- one of UNCONFIRMED, NEW, ASSIGNED, or REOPENED
-
- bugList - optional, specify the list of bugs to update
- a non-digit (space, comma, semicolon, etc) delimited list of integers corresponding to Bugzilla bugIDs
- if you specify this, you cannot specify milestone or product
-
- product - required (if no bugList), only query for bugs on this product
- this cargument annot be combined with bugList
-
- buildAlias - optional label, the task adds a comment to Bugzilla of the form
- "Fixed in $buildAlias ($buildID).", otherwise uses buildID or just "Fixed in latest build."
-
- buildID - optional label, the task adds a comment to Bugzilla of the form
- "Fixed in $buildAlias ($buildID).", otherwise uses buildAlias or just "Fixed in latest build."
- of the format YYYYMMDDHHMM, [IMNRS]YYYYMMDDHHMM, [IMNRS]-YYYYMMDDHHMM
- YYYYMMDD-HHMM, [IMNRS]YYYYMMDD-HHMM, or [IMNRS]-YYYYMMDD-HHMM
-
- endDate - optional, only query for bugs last updated before this timestamp
- (that is, bugs after this timestamp will be ignored). Must be in the form yyyymmddHHMM or yyyymmdd0000.
- this argument cannot be combined with bugList
-
- milestone - optional, only query for bugs that have this milestone
- this argument cannot be combined with bugList
-
- resolution - optional, this is what the bug's new state will be
- one of FIXED, INVALID, WONTFIX, LATER, REMIND, or WORKSFORME (default: FIXED)
-
- debug - optional, use this to control task verbosity
- 0 - only print a message if the task needs to abort
- 1 - show progress (and errors, if any) (default)
- 2 - maximum verbosity, probably only useful if something goes wrong
- values < 0 are equivalent to 0
- values > 2 are equivalent to 2
-
- Examples: -->
-
- <!--
- 1. find all bugs last updated before 2006/06/01 17:38 from product EMF in the ASSIGNED state;
- move to FIXED using buildID S200606051102 and buildAlias 2.2.0RC7. Comment will be:
- "Fixed in 2.2.0RC7 (S200606051102)."
- -->
- <UpdateBugState login="${login}" logincookie="${logincookie}"
- status="ASSIGNED" product="EMF" endDate="200606011738"
- resolution="FIXED" buildID="S200606051102" buildAlias="2.2.0RC7"
- />
-
- <!--
- 2. find all bugs from product EMF targetted for milestone "2.2" which are in the ASSIGNED state;
- move to FIXED. Comment will be:
- "Fixed in latest build."
- -->
- <UpdateBugState debug="2" login="${login}" logincookie="${logincookie}"
- status="ASSIGNED" product="EMF"
- resolution="FIXED" milestone="2.2"
- />
-
- <!--
- 3. find all bugs in given list (131811 144877 144890 144989) which are still in the ASSIGNED state
- (to avoid duplicate updates); move to FIXED using buildID I200606051102. Comment will be:
- "Fixed in I200606051102."
- -->
- <UpdateBugState login="${login}" logincookie="${logincookie}"
- status="ASSIGNED" bugList="131811 144877 144890 144989"
- resolution="FIXED" buildID="S200606051102"
- />
-
- </target>
-</project>
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/README.searchcvs.setup.mysql.txt b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/README.searchcvs.setup.mysql.txt
deleted file mode 100644
index 865ed36..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/README.searchcvs.setup.mysql.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Search CVS is a tool for converting cvs commits into a mysql database, which
-can be updated without worry of data duplication. The database is then searchable
-via a web page run on www.eclipse.org.
-
-MySQL Server Quick Setup:
-
-1. Extract the searchcvs/ folder from cvs and place it in your $HOME folder
-on some server running MySQL 5 and PHP 4 or 5 with the MySQL module for MySQL 5 compiled in.
-
-2. Customize setup.sh for your needs and run it to extract your code from cvs.
-
-3. Load database tables using .dump files provided.
-
-4. Edit includes/parsecvs-dbaccess.php. Run parsecvs.sh.
-
-5. To make nightly updates to the data (reflecting the day's cvs commits), run parsecvs.sh as a cron like this:
-
-#Min Hr Mday Month Wday Cmd
-00 22 * * * $HOME/searchcvs/parsecvs.sh 2>&1 1> $HOME/searchcvs/parsecvs.log.txt
-
-----
-
-Additional details on setup and on using this tool can be found here:
-
-http://wiki.eclipse.org/index.php/Search_CVS
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/README.searchcvs.setup.web.txt b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/README.searchcvs.setup.web.txt
deleted file mode 100644
index 2021731..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/README.searchcvs.setup.web.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Search CVS is a tool for converting cvs commits into a mysql database, which
-can be updated without worry of data duplication. The database is then searchable
-via a web page run on www.eclipse.org.
-
-Web Server Quick Setup:
-
-1. See searchcvs/www/README.
-
-----
-
-Additional details on setup and on using this tool can be found here:
-
-http://wiki.eclipse.org/index.php/Search_CVS
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/includes/parsecvs-dbaccess.php b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/includes/parsecvs-dbaccess.php
deleted file mode 100644
index ca5187f..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/includes/parsecvs-dbaccess.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
- $dbhost = "mysqlserver";
- $dbuser = "dbaccessrw";
- $dbpass = "dbaccessrwpassword";
-?>
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-modelingschema.dump b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-modelingschema.dump
deleted file mode 100644
index a33d400..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-modelingschema.dump
+++ /dev/null
@@ -1,161 +0,0 @@
--- MySQL dump 10.10
---
--- You can load this file into mysql using:
--- $ mysql -u root -p < mysql-modelingschema.dump
---
--- Note that the database name for the stored CVS data is `modeling`, as in the Eclipse Modeling Project.
--- You'll probably want to change that for your project's needs.
---
--- Host: localhost Database: modeling
--- ------------------------------------------------------
--- Server version 5.0.22-log
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
-/*!40103 SET TIME_ZONE='+00:00' */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
-DROP DATABASE IF EXISTS `modeling`;
-CREATE DATABASE `modeling`;
-
-USE `modeling`;
-
---
--- Table structure for table `bugs`
---
-
-DROP TABLE IF EXISTS `bugs`;
-CREATE TABLE `bugs` (
- `fid` smallint(5) unsigned NOT NULL,
- `revision` varchar(15) NOT NULL,
- `bugid` mediumint(8) unsigned NOT NULL,
- PRIMARY KEY (`fid`,`revision`,`bugid`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Dumping data for table `bugs`
---
-
-
-/*!40000 ALTER TABLE `bugs` DISABLE KEYS */;
-LOCK TABLES `bugs` WRITE;
-UNLOCK TABLES;
-/*!40000 ALTER TABLE `bugs` ENABLE KEYS */;
-
---
--- Table structure for table `commits`
---
-
-DROP TABLE IF EXISTS `commits`;
-CREATE TABLE `commits` (
- `fid` smallint(5) unsigned NOT NULL,
- `revision` varchar(15) NOT NULL,
- `date` datetime NOT NULL,
- `author` varchar(20) NOT NULL,
- `state` enum('Exp','dead') NOT NULL,
- `linesplus` smallint(5) unsigned default NULL,
- `linesminus` smallint(5) unsigned default NULL,
- `message` text NOT NULL,
- PRIMARY KEY (`fid`,`revision`),
- KEY `author` (`author`),
- FULLTEXT KEY `message` (`message`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Dumping data for table `commits`
---
-
-
-/*!40000 ALTER TABLE `commits` DISABLE KEYS */;
-LOCK TABLES `commits` WRITE;
-UNLOCK TABLES;
-/*!40000 ALTER TABLE `commits` ENABLE KEYS */;
-
---
--- Table structure for table `cvsfiles`
---
-
-DROP TABLE IF EXISTS `cvsfiles`;
-CREATE TABLE `cvsfiles` (
- `fid` int(11) NOT NULL auto_increment,
- `cvsname` text NOT NULL,
- `head` varchar(15) NOT NULL,
- `keyword_subs` enum('b','k','kv','kvl','v') NOT NULL,
- `project` varchar(50) NOT NULL,
- PRIMARY KEY (`fid`),
- KEY `project` (`project`),
- UNIQUE KEY `cvsname` (`cvsname`(333))
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Dumping data for table `cvsfiles`
---
-
-
-/*!40000 ALTER TABLE `cvsfiles` DISABLE KEYS */;
-LOCK TABLES `cvsfiles` WRITE;
-UNLOCK TABLES;
-/*!40000 ALTER TABLE `cvsfiles` ENABLE KEYS */;
-
---
--- Table structure for table `filetags`
---
-
-DROP TABLE IF EXISTS `filetags`;
-CREATE TABLE `filetags` (
- `fid` mediumint(8) unsigned NOT NULL,
- `tid` smallint(5) unsigned NOT NULL,
- `revision` varchar(15) NOT NULL,
- PRIMARY KEY (`fid`,`tid`),
- KEY `tid` (`tid`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Dumping data for table `filetags`
---
-
-
-/*!40000 ALTER TABLE `filetags` DISABLE KEYS */;
-LOCK TABLES `filetags` WRITE;
-UNLOCK TABLES;
-/*!40000 ALTER TABLE `filetags` ENABLE KEYS */;
-
---
--- Table structure for table `tags`
---
-
-DROP TABLE IF EXISTS `tags`;
-CREATE TABLE `tags` (
- `tid` int(11) NOT NULL auto_increment,
- `tagname` varbinary(50) NOT NULL,
- `tagdate` datetime default NULL,
- PRIMARY KEY (`tid`),
- UNIQUE KEY `tagname` (`tagname`),
- KEY `tagdate` (`tagdate`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Dumping data for table `tags`
---
-
-
-/*!40000 ALTER TABLE `tags` DISABLE KEYS */;
-LOCK TABLES `tags` WRITE;
-UNLOCK TABLES;
-/*!40000 ALTER TABLE `tags` ENABLE KEYS */;
-/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-modelingschema.truncate b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-modelingschema.truncate
deleted file mode 100644
index 9d8349c..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-modelingschema.truncate
+++ /dev/null
@@ -1,9 +0,0 @@
--- You can load this file into mysql using:
--- $ mysql -u root -p < mysql-modelingschema.truncate
-
-USE `modeling`;
-TRUNCATE TABLE `bugs`;
-TRUNCATE TABLE `commits`;
-TRUNCATE TABLE `cvsfiles`;
-TRUNCATE TABLE `filetags`;
-TRUNCATE TABLE `tags`;
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-users.dump b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-users.dump
deleted file mode 100644
index 5d83e25..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/mysql-users.dump
+++ /dev/null
@@ -1,19 +0,0 @@
--- Note: use the same username/password values here as set in
--- includes/parsecvs-dbaccess.php and in
--- www/projectName/includes/searchcvs-dbaccess.php
---
--- You can load this file into mysql using:
--- $ mysql -u root -p < mysql-users.dump
-
--- Note that the database name for the stored CVS data is `modeling`, as in the Eclipse Modeling Project.
--- You'll probably want to change that for your project's needs.
-
--- Local access (cvs parser) granted to read/write for user 'dbaccessrw' with password 'dbaccessrwpassword'
-CREATE USER 'dbaccessrw'@'localhost' IDENTIFIED BY 'dbaccessrwpassword';
-GRANT USAGE ON *.* TO 'dbaccessrw'@'localhost' IDENTIFIED BY 'dbaccessrwpassword' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
-GRANT ALL PRIVILEGES ON `dbaccessrw`.* TO 'dbaccessrw'@'localhost';
-
--- Remote access (website) granted to read only for user 'dbaccessro' with password 'dbaccessropassword'
-CREATE USER 'dbaccessro'@'%eclipse.org' IDENTIFIED BY 'dbaccessropassword';
-GRANT USAGE ON *.* TO 'dbaccessro'@'%eclipse.org' IDENTIFIED BY 'dbaccessropassword' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
-GRANT SELECT ON `modeling`.* TO 'dbaccessro'@'%eclipse.org';
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/parsecvs.php b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/parsecvs.php
deleted file mode 100644
index 9b9c4fd..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/parsecvs.php
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/usr/bin/php
-
-<?php
-/*
-RCS file: /cvsroot/tools/org.eclipse.emf/.cvsignore,v //store
-Working file: .cvsignore //don't need to store, basename(rcs file), minus ,v?
-head: 1.1 //maybe store, could be calculated based on tags table?
-branch: //probably store, what does this actually mean?, never used (always empty)?
-locks: strict //store, though not used (always strict)?
-access list: //store, though not used (always empty)?
-symbolic names: //do we actually need to store these? we'll see
- build_200608030000: 1.1
- ...
-keyword substitution: kv //store, 'b', 'k', 'kv', 'kvl', 'v' are (currently) used
-total revisions: 2; selected revisions: 2 //don't store, is count of commits to the file
-description: //is this a title for the revisions? probably
-----------------------------
-revision 1.1
-date: 2004/03/06 18:22:28; author: marcelop; state: Exp;
-branches: 1.1.2;
-Move the EMF, XSD and SDO source code to the Eclipse.org repository
-----------------------------
-revision 1.1.2.1
-date: 2005/06/02 16:09:17; author: nickb; state: Exp; lines: +0 -0
-*** empty log message ***
-=============================================================================
-*/
-
-$db = "modeling"; /* database name. change this to match your project or can leave as is */
-
-$perfile_regex = "/^RCS\ file:\ (.+?$)\\n
- ^Working\ file:\ (.+?$)\\n
- ^head:\ (.+?$)\\n
- ^branch:\ ?(.*?$)\\n
- ^locks:\ (.+?$)\\n
- ^access\ list:\ ?(.*?$)\\n
- (?:^symbolic\ names:\ ?(.*?$)\\n
- ((?:^\\t\S+:\ [0-9\.]+$\\n)+))?
- ^keyword\ substitution:\ (.+?$)\\n
- ^total\ revisions:\ (\d+);\\tselected\ revisions:\ (\d+)$\\n
- ^description:\ ?(.*?$)\\n
- ^((?:\-{28}.+$\\n)?
- ^={77})$/smx";
-
-$percommit_regex = "#^\-{28}$\\n
- ^revision\ ([0-9\.]+)$\\n
- ^date:\ (\d{4}/\d\d/\d\d\ \d\d:\d\d:\d\d);\ \ author:\ (\S+);\ \ state:\ (\S+);(?:\ \ lines:\ \+(\d+)\ \-(\d+))?$\\n
- (?:^branches:(?:\ \ ([0-9\.]+);)+$\\n)?
- ^(.+?)$\\n
- ^(?:\-{28}|={77})#smx";
-
-$bugs_regex = "@(?:
- \[\#?(\d+)\]
- |
- (?:Bugzilla)?\#(\d+)
- |
- https?\Q://bugs.eclipse.org/bugs/show_bug.cgi?id=\E(\d+)
- )@x";
-
-include_once "includes/parsecvs-dbaccess.php";
-$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Couldn't connect to database!\n");
-mysql_select_db($db, $connect) or die(mysql_error());
-$file = file_get_contents(($argv[1] ? $argv[1] : "php://stdin"));
-
-wmysql_query("CREATE TEMPORARY TABLE `tmptags` (`tagname` VARBINARY(255), `revision` VARCHAR(20), PRIMARY KEY (`tagname`)) ENGINE = memory");
-
-preg_match_all("/^(RCS file:.+?^={77}$)/sm", $file, $regs) or die("Couldn't find any cvs logs!\n");
-foreach ($regs[0] as $z)
-{
- /* parse each file's info */
- if (preg_match($perfile_regex, $z, $props))
- {
- $esc = array(1, 3, 9);
- foreach ($esc as $y)
- {
- $props[$y] = mysql_real_escape_string($props[$y], $connect);
- }
- preg_match("/^\/cvsroot\/[^\/]+\/([^\/]+)\//", $props[1], $proj);
- $q = "`project` = '$proj[1]', `head` = '$props[3]', `keyword_subs` = '$props[9]'";
- wmysql_query("INSERT INTO `cvsfiles` SET `cvsname` = '$props[1]', $q ON DUPLICATE KEY UPDATE $q");
- /* mysql_insert_id() won't work if we updated rather than inserted */
- $result = wmysql_query("SELECT `fid` FROM `cvsfiles` WHERE `cvsname` = '$props[1]'");
- $row = mysql_fetch_row($result);
-
- /* parse symbolic names */
- $tags = array();
- $filetags = array();
- $count = preg_match_all("/^\t(\S+): ([0-9\.]+)$\n/m", $props[8], $syms);
- for ($i=0;$i<$count;$i++)
- {
- array_push($filetags, "('{$syms[1][$i]}', '{$syms[2][$i]}')");
- }
- if ($count > 0)
- {
- $syms[1] = preg_replace("/^(.+)$/e", "fixup('$1')", $syms[1]);
- wmysql_query("INSERT INTO `tags` (`tagname`, `tagdate`) VALUES " . join($syms[1], ",") . " ON DUPLICATE KEY UPDATE `tid` = `tid`");
- wmysql_query("INSERT INTO `tmptags` (`tagname`, `revision`) VALUES " . join($filetags, ","));
- wmysql_query("INSERT INTO `filetags` SELECT $row[0], `tid`, `revision` FROM `tmptags` NATURAL JOIN `tags` ON DUPLICATE KEY UPDATE `filetags`.`revision` = `tmptags`.`revision`");
- wmysql_query("TRUNCATE TABLE `tmptags`");
- }
-
- $commits = $props[13];
- /* parse commits */
- while (preg_match($percommit_regex, $commits, $revs))
- {
- $commits = substr($commits, strlen($revs[0]) - 28); //leave the \-{28} in tact
- $revs[8] = mysql_real_escape_string($revs[8], $connect);
- $q = "`date` = STR_TO_DATE('$revs[2]', '%Y/%m/%d %T'), `author` = '$revs[3]', `state` = '$revs[4]', `linesplus` = '$revs[5]', `linesminus` = '$revs[6]', `message` = '$revs[8]'";
- wmysql_query("INSERT INTO `commits` SET `fid` = '$row[0]', `revision` = '$revs[1]', $q ON DUPLICATE KEY UPDATE $q");
-
- /* parse bug numbers */
- if (preg_match_all($bugs_regex, $revs[8], $ubugs))
- {
- unset($ubugs[0]);
- $bugs = extract_bugs($ubugs);
- $bugs = preg_replace("/^(.+)$/", "('$row[0]', '$revs[1]', '$1')", $bugs);
- wmysql_query("INSERT INTO `bugs` (`fid`, `revision`, `bugid`) VALUES " . join($bugs, ",") . " ON DUPLICATE KEY UPDATE `bugid` = `bugid`");
- }
- }
- }
-}
-wmysql_query("DROP TEMPORARY TABLE `tmptags`");
-
-$tables = array();
-mysql_select_db("INFORMATION_SCHEMA") or die(mysql_error());
-$result = wmysql_query("SELECT TABLE_NAME FROM TABLES WHERE `TABLE_SCHEMA` = '$db' AND `TABLE_TYPE` = 'BASE TABLE'");
-while ($row = mysql_fetch_row($result))
-{
- array_push($tables, $row[0]);
-}
-
-mysql_select_db($db) or die(mysql_error());
-wmysql_query("OPTIMIZE TABLE " . join($tables, ","));
-wmysql_query("ANALYZE TABLE " . join($tables, ","));
-mysql_close($connect);
-
-function fixup($str)
-{
- return "('$str', " . (preg_match("/^build_(\d{12})$/", $str, $regs) ? "STR_TO_DATE('$regs[1]', '%Y%m%d%k%i')" : "NULL") . ")";
-}
-
-function wmysql_query($sql)
-{
- $res = mysql_query($sql) or die("$sql\n" . mysql_error() . "\n");
- return $res;
-}
-
-function extract_bugs($regs)
-{
- foreach ($regs as $z)
- {
- foreach ($z as $y)
- {
- if (preg_match("/^\d+$/", $y))
- {
- $bugs[] = $y;
- }
- }
- }
-
- return $bugs;
-}
-?>
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/parsecvs.sh b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/parsecvs.sh
deleted file mode 100755
index a261e22..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/parsecvs.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#/bin/bash
-
-CVSOPTS="-Q";
-
-cd ${0%/*}; # cd to directory where this script is located; cvssrc/ must be beneath it
-
-# pass in specific target folder(s) or do all in cvssrc/ folder
-dir="";
-if [ $# -gt 0 ]; then
- while [ $# -gt 0 ]; do
- dir=$dir" $1"; shift 1;
- done
-else
- dir="$(ls -d cvssrc/*)";
-fi
-
-for i in $dir; do
- echo "[`date +%H:%M:%S`] Processing $i";
- cd $i;
- cvs $CVSOPTS up -Pd .;
- f=$(mktemp)
- cvs $CVSOPTS log > $f
- echo $f | /usr/local/bin/php ../../parsecvs.php;
- rm -f $f
- cd ../..;
- echo "[`date +%H:%M:%S`] done.";
-done
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/setup.sh b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/setup.sh
deleted file mode 100755
index 0fa1a4b..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/setup.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-# setup script for use with Neil Skrypuch's Search CVS tool
-
-# used to check out cvs content so that it can be logged by parsecvs.sh
-
-checkoutdir="$HOME/searchcvs/cvssrc";
-quietcvs="-Q";
-
-mkdir -p $checkoutdir;
-
-checkoutProjects ()
-{
- CVSROOT=$1;
- project=$2;
- cd $checkoutdir;
- echo "[`date +%H:%M:%S`] Check out $checkoutdir/$project from $CVSROOT ...";
- cvs -d :pserver:anonymous@dev.eclipse.org:$CVSROOT $quietcvs co $project;
-}
-
-# list projects to extract; add other cvs roots (eg. /cvsroot/modeling) as necessary below
-webprojects="emf emft uml2 mdt modeling";
-toolsprojects="org.eclipse.emf org.eclipse.xsd org.eclipse.emf.ecore.sdo org.eclipse.emf.releng.build org.eclipse.uml2 org.eclipse.uml2.releng";
-techprojects="org.eclipse.emft org.eclipse.gmf org.eclipse.corona";
-eclipseprojects="org.eclipse.releng org.eclipse.releng.basebuilder org.eclipse.releng.eclipsebuilder org.eclipse.releng.tools org.eclipse.releng.tests org.eclipse.pde org.eclipse.pde.core org.eclipse.pde.ui.tests org.eclipse.pde.runtime org.eclipse.pde.junit.runtime org.eclipse.pde.source org.eclipse.pde.build org.eclipse.pde.junit org.eclipse.pde.doc.user org.eclipse.pde.ui"
-modelingprojects="gmf emf org.eclipse.mdt org.eclipse.mdt.releng releng-common"
-
-# do checkouts for each cvs root's projects
-for f in $webprojects; do checkoutProjects /cvsroot/org.eclipse www/$f; done
-for f in $toolsprojects; do checkoutProjects /cvsroot/tools $f ; done
-for f in $techprojects; do checkoutProjects /cvsroot/technology $f ; done
-for f in $eclipseprojects; do checkoutProjects /cvsroot/eclipse $f ; done
-for f in $modelingprojects; do checkoutProjects /cvsroot/modeling $f ; done
-
-echo "[`date +%H:%M:%S`] Done.";
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/README.folder.contents.may.not.be.up.to.date.txt b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/README.folder.contents.may.not.be.up.to.date.txt
deleted file mode 100644
index 4ab1741..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/README.folder.contents.may.not.be.up.to.date.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-Search CVS is a tool for converting cvs commits into a mysql database, which
-can be updated without worry of data duplication. The database is then searchable
-via a web page run on www.eclipse.org.
-
-This folder is a copy of the contents of another cvs repository for example purposes only,
-and should not be considered up to date. It is provided here simply to make this code base
-more complete and to provide a self-contained runnable example.
-
-For the latest version of this folder's contents, see:
-
-:pserver:anonymous@dev.eclipse.org:/cvsroot/org.eclipse/www/emf/
- searchcvs.php
- includes/searchcvs.css
- includes/db.php
-
-Additionally, there is a non-public file called includes/searchcvs-dbaccess.php (referenced by
-includes/db.php) which reads something like this:
-
-<?php
- $dbhost = "mysqlserver";
- $dbuser = "dbaccessro";
- $dbpass = "dbaccessropassword";
-?>
-
-** WARNING: DO NOT COMMIT THIS FILE INTO YOUR PUBLIC CVS REPOSITORY! **
-
-To put this file on the www.eclipse.org server without it being available in CVS for public view,
-place a copy of the file in your home directory on dev.eclipse.org, then open a bug
-(https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community) or send a note to webmaster@eclipse.org
-and ask to have the file placed for you. Example: https://bugs.eclipse.org/bugs/show_bug.cgi?id=156451#c8
-
-----
-
-Additional details on setup and on using this tool can be found here:
-
-http://wiki.eclipse.org/index.php/Search_CVS
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/db.php b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/db.php
deleted file mode 100644
index 7fafa85..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/db.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/emf/includes/searchcvs-dbaccess.php";
-$connect = mysql_connect($dbhost, $dbuser, $dbpass);
-mysql_select_db($db ? $db : "modeling", $connect) or die(mysql_error());
-
-function wmysql_query($sql)
-{
- #print $sql . "\n";
- $res = mysql_query($sql) or die("$sql\n" . mysql_error());
- return $res;
-}
-?>
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/searchcvs-dbaccess.php b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/searchcvs-dbaccess.php
deleted file mode 100644
index c1de49a..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/searchcvs-dbaccess.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
- $dbhost = "mysqlserver";
- $dbuser = "dbaccessro";
- $dbpass = "dbaccessropassword";
-?>
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/searchcvs.css b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/searchcvs.css
deleted file mode 100644
index 08ee8b3..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/includes/searchcvs.css
+++ /dev/null
@@ -1,101 +0,0 @@
-abbr
-{
- border-bottom: 1px dotted gray;
- /* removes konqueror's custom abbr style */
- font: inherit;
- letter-spacing: inherit;
-}
-
-#midcolumn .homeitem3col h3 span
-{
- float: right;
-}
-
-#midcolumn .homeitem3col ul li div
-{
- float: right;
- padding-left: 2em;
-}
-
-#midcolumn .homeitem3col ul li
-{
- clear: both;
-}
-
-#midcolumn .homeitem3col ul li ul li
-{
- border-style: none;
- padding: 0;
-}
-
-#midcolumn .homeitem3col .pager
-{
- text-align: center;
- padding: 1em 0 1em 0;
-}
-
-#midcolumn .homeitem3col .pager span
-{
- margin: 0.5em;
- padding: 0.3em;
-}
-
-#midcolumn .homeitem3col .pager span.selected
-{
- border-bottom: 1px dotted black;
- border-top: 1px dotted black;
- font-weight: bold;
-}
-
-#midcolumn .homeitem3col #searchdiv
-{
- text-align: center;
- padding-top: 1em;
-}
-
-#midcolumn .homeitem3col ul li ul li span.empty
-{
- color: gray;
-}
-
-#midcolumn .homeitem3col ul li ul li span.hl0,
-#midcolumn .homeitem3col ul li ul li span.hl7
-{
- background-color: #FFFF66;
-}
-
-#midcolumn .homeitem3col ul li ul li span.hl1,
-#midcolumn .homeitem3col ul li ul li span.hl8
-{
- background-color: #FF66FF;
-}
-
-#midcolumn .homeitem3col ul li ul li span.hl2,
-#midcolumn .homeitem3col ul li ul li span.hl9
-{
- background-color: #66FFFF;
-}
-
-#midcolumn .homeitem3col ul li ul li span.hl3,
-#midcolumn .homeitem3col ul li ul li span.hl10
-{
- background-color: #AAAAFF;
-}
-
-#midcolumn .homeitem3col ul li ul li span.hl4,
-#midcolumn .homeitem3col ul li ul li span.hl11
-{
- background-color: #AAFFAA;
-}
-
-#midcolumn .homeitem3col ul li ul li span.hl5,
-#midcolumn .homeitem3col ul li ul li span.hl12
-{
- background-color: #FFAAAA;
-}
-
-#midcolumn .homeitem3col ul li ul li span.hl6,
-#midcolumn .homeitem3col ul li ul li span.hl13
-{
- background-color: #CCCCCC;
-}
diff --git a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/searchcvs.php b/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/searchcvs.php
deleted file mode 100644
index a379b81..0000000
--- a/bundles/org.eclipse.build.tools/scripts_cvs/searchcvs/www/projectName/searchcvs.php
+++ /dev/null
@@ -1,267 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon());
-ob_start();
-
-include("includes/db.php");
-
-$pagesize = 25; //results per page
-$scroll = 5; //+- pages to show in nav
-$days = 7;
-$page = (preg_match("/^\d+$/", $_GET["p"]) ? $_GET["p"] : 1);
-$offset = ($page - 1) * $pagesize;
-
-$where = "WHERE `date` >= DATE_SUB(CURDATE(), INTERVAL $days DAY)";
-$order = "ORDER BY `date` DESC";
-
-$extraf = array(
- array("regex" => "/author: ?(\S+)/", "sql" => "`author` LIKE '%%%s%%'", "sqlpart" => "where"),
- array("regex" => "/file: ?(\S+)/", "sql" => "`cvsname` LIKE '%%%s%%'", "sqlpart" => "where"),
- array("regex" => "/days: ?(\d+)/", "sql" => "`date` >= DATE_SUB(CURDATE(), INTERVAL %d DAY)", "sqlpart" => "where"),
- array("regex" => "/(?:project|module): ?(\S+)/", "sql" => "`project` LIKE '%s'", "sqlpart" => "where"),
- array("regex" => "/branch: ?(\S+)/", "sql" => "`branch` LIKE '%%%s%%'", "sqlpart" => "having") //is a calculated value, won't work in WHERE
-);
-
-$q = (get_magic_quotes_gpc() ? $_GET["q"] : addslashes($_GET["q"]));
-$extra = array("where" => array(), "having" => array());
-foreach ($extraf as $z)
-{
- while (preg_match($z["regex"], $q, $regs))
- {
- array_push($extra[$z["sqlpart"]], sprintf($z["sql"], $regs[1]));
- $q = preg_replace($z["regex"], "", $q);
- }
-}
-
-$regs = array();
-/* this *could* be put into $extraf, but it would change the semantics slightly, in that any number searched for would be treated as a bug #, which i think is undesirable */
-if (preg_match("/^\s*\[?(\d+)\]?\s*$/", $_GET["q"], $regs))
-{
- $_GET["q"] = $regs[1];
- $where = "WHERE `bugid` = $regs[1]";
- $et = "Bug #";
-}
-else if (preg_match("/(\S)/", $q, $regs) || sizeof($extra["where"]) + sizeof($extra["having"]) > 0)
-{
- $match = "'1'";
- if (sizeof($regs) > 0)
- {
- $match = "MATCH(`message`) AGAINST('$q'" . (preg_match("/\".+\"/", $q) ? " IN BOOLEAN MODE" : "") . ")";
- }
- $where = "WHERE " . ($match ? $match : "1");
- $where .= (sizeof($extra["where"]) > 0 ? " AND " . join($extra["where"], " AND ") : "");
- $having = (sizeof($extra["having"]) > 0 ? " HAVING " . join($extra["having"], " AND ") : "");
- $ec = ", $match AS `relevance`";
- $order = "ORDER BY `relevance` DESC, `date` DESC";
-}
-?>
-<div id="midcolumn">
-<div class="homeitem3col">
- <h3>Search</h3>
- <div id="searchdiv">
- <form action="" method="get">
- <input type="text" size="60" id="q" name="q"<?php print ($_GET["q"] ? " value=\"" . sanitize($_GET["q"], "text") . "\"" : ""); ?>/>
- <input type="submit" value="Go!"/>
- </form>
- </div>
-</div>
-<?php
-
-/* 1.1.2.x <- 1.1.0.2 = branch tag, likewise, 1.1.4.x <- 1.1.0.4 = branch tag, so dynamically rewrite a.b.c.d to a.b.0.c to find the branch tag */
-$branch = "IF(`revision` LIKE '%.%.%.%', (SELECT `tagname` FROM `tags` NATURAL JOIN `filetags` WHERE `fid` = `ofid` AND `revision` = CONCAT(SUBSTRING_INDEX(`orev`, '.', 2), '.0.', SUBSTRING_INDEX(SUBSTRING_INDEX(`orev`, '.', -2), '.', 1))), 'HEAD')";
-$sql = "SELECT SQL_CALC_FOUND_ROWS `cvsname`, `revision`, `date`, `author`, `message`, `keyword_subs`, `bugid`, `revision` AS `orev`, `fid` AS `ofid`, $branch AS `branch`$ec FROM `cvsfiles` NATURAL JOIN `commits` NATURAL LEFT JOIN `bugs` $where GROUP BY `fid`, `revision`, `bugid` $having $order LIMIT $offset, $pagesize";
-$result = wmysql_query($sql);
-
-$count = wmysql_query("SELECT FOUND_ROWS()"); //mysql_num_rows() doesn't do what we want here
-$row = mysql_fetch_row($count);
-$rows = $row[0];
-
-$title = "<span>$rows results total</span>Showing results " . ($offset + 1) . "-" . ($offset + $pagesize > $rows ? $rows : $offset + $pagesize) . " for " . ($_GET["q"] == "" ? "last $days days of commits" : "$et" . sanitize($_GET["q"], "text"));
-$title = ($rows == 0 ? "No results found for " . sanitize($_GET["q"], "text") . "" : $title);
-
-print "<div class=\"homeitem3col\">\n";
-print "<h3>$title</h3>\n";
-
-dopager($rows, $page, $pagesize);
-
-print "<ul>\n";
-
-while ($row = mysql_fetch_assoc($result))
-{
- $file = basename($row["cvsname"], ",v");
- $row["cvsname"] = preg_replace("#^/cvsroot/[^\/]+/(.+),v$#", "$1", $row["cvsname"]);
- print "<li>\n";
- print "<div>{$row['date']}</div>";
- print ($row["bugid"] ? "[<a href=\"https://bugs.eclipse.org/bugs/show_bug.cgi?id={$row['bugid']}\">{$row['bugid']}</a>] " : "");
- print "<a href=\"" . cvsfile($row["cvsname"]) . "\"><abbr title=\"{$row['cvsname']}\">$file</abbr></a> ({$row['branch']} " . showrev($row['revision'], $row["cvsname"]) . ")";
- print "<ul>\n";
- print "<li><div>{$row['author']}</div>" . pretty_comment($row["message"], $q) . "</li>";
- print "</ul>\n";
- print "</li>\n";
-}
-print "</ul>\n";
-
-dopager($rows, $page, $pagesize);
-
-print "</div>\n";
-print "</div>\n";
-mysql_close($connect);
-?>
-<div id="rightcolumn">
- <div class="sideitem">
- <h6>Help</h6>
- <p><a href="http://wiki.eclipse.org/index.php/Search_CVS">Consult the wiki</a>, or try these examples:</p>
- <ul>
- <li><a href="?q=%5B155286%5D">[155286]</a></li>
- <li><a href="?q=98877+file%3A+ChangeAdapter">98877 file: ChangeAdapter</a></li>
- <li><a href="?q=file%3A+org.eclipse.emf%2F+days%3A+7">file: org.eclipse.emf/ days: 7</a></li>
- <li><a href="?q=days%3A200+author%3Amerks">days:200 author:merks</a></li>
- <li><a href="?q=branch%3A+R2_1_+file%3A+.xml">branch: R2_1_ file: .xml</a></li>
- <li><a href="?q=static+dynamic+project%3A+org.eclipse.emf">static dynamic project: org.eclipse.emf</a></li>
- <li><a href="?q=%22package+protected%22">"package protected"</a></li>
- <li><a href="?q=Neil+Skrypuch">Neil Skrypuch</a></li>
- </ul>
- <p>See also the complete <a href="http://wiki.eclipse.org/index.php/Search_CVS#Parameter_List">Parameter List</a>.</p>
- </div>
-</div>
-<?php
-$html = ob_get_contents();
-ob_end_clean();
-
-$pageTitle = "Eclipse Tools - Search CVS";
-$pageKeywords = "";
-$pageAuthor = "Neil Skrypuch";
-
-$App->AddExtraHtmlHeader('<link rel="stylesheet" type="text/css" href="/emf/includes/searchcvs.css"/>' . "\n");
-if (!isset($_GET["totalonly"]))
-{
- ob_start();
- $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
- $html = ob_get_contents();
- ob_end_clean();
- print preg_replace("/<body>/", "<body onload=\"document.getElementById('q').focus()\">", $html);
-}
-else
-{
- header("Content-Type: text/plain");
- print $rows;
-}
-
-function pretty_comment($str, $hl)
-{
- $str = preg_replace("/\n/", "<br/>", $str);
- $hl = words($hl);
-
- for ($i = 0; $i < sizeof($hl); $i++)
- {
- $str = preg_replace("/\b(\Q$hl[$i]\E)\b([^=]|\Z)/i", "<span class=\"hl$i\">$1</span>$2", $str);
- }
-
- $str = preg_replace("/^(\Q*** empty log message ***\E)$/", "<span class=\"empty\">$1</span>", $str);
-
- return $str;
-}
-
-function cvsminus($rev)
-{
- if (preg_match("/^1\.1$/", $rev)) // "1.10" == "1.1" returns true, curiously enough
- {
- return $rev;
- }
- else
- {
- if (preg_match("/\.1$/", $rev))
- {
- return preg_replace("/^(\d+\.\d+)\..+$/", "$1", $rev);
- }
- else
- {
- return preg_replace("/^(.+\.)(\d+)$/e", "\"$1\" . ($2 - 1);", $rev);
- }
- }
-}
-
-function showrev($rev, $file)
-{
- $link = "<a href=\"" . cvsfile($file) . "\">$rev</a>";
- if (!preg_match("/^1\.1$/", $rev)) // "1.10" == "1.1" returns true, curiously enough
- {
- $oldrev = cvsminus($rev);
- $link = "<a href=\"" . cvsfile($file, $rev, $oldrev) . "\">$rev > $oldrev</a>";
- }
-
- return $link;
-}
-
-function cvsfile($file, $rev = "", $oldrev = "")
-{
- if ($rev && $oldrev)
- {
- $ext = ".diff";
- $params = "r1=$oldrev&r2=$rev&";
- }
- $params .= (preg_match("/\.php$/", $file) && $ext != ".diff" ? "content-type=text/plain&" : "");
-
- if (preg_match("/^www/", $file))
- {
- return "http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/$file$ext?${params}cvsroot=Eclipse_Website";
- }
- else
- {
- return "http://dev.eclipse.org/viewcvs/indextools.cgi/~checkout~/$file$ext?$params";
- }
-}
-
-function sanitize($str, $type = "url")
-{
- $tmp = urlencode(urldecode((get_magic_quotes_gpc() ? stripslashes($str) : $str)));
- return ($type == "url" ? $tmp : htmlspecialchars(urldecode($tmp)));
-}
-
-function pagelink($page, $selected, $linktext = "")
-{
- $innertext = ($linktext ? $linktext : $page);
- $text = (!$selected ? "<a href=\"?q=" . sanitize($_GET["q"]) . "&p=$page\">$innertext</a>" : $innertext);
- return "<span" . ($selected ? " class=\"selected\"" : "") . ">$text</span>";
-}
-
-function dopager($rows, $page, $pagesize)
-{
- $startpage = ($page - 5 < 1 ? 1 : $page - 5);
- $endpage = ($page + 5 > $rows/$pagesize ? ceil($rows/$pagesize) : $page + 5);
-
- if ($rows > 0)
- {
- print "<div class=\"pager\">\n";
- print ($page > 1 ? pagelink($page - 1, false, "Previous") : "");
- for ($i = $startpage; $i <= $endpage; $i++)
- {
- print pagelink($i, $i == $page);
- }
- print ($page < ceil($rows/$pagesize) ? pagelink($page + 1, false, "Next") : "");
- print "</div>\n";
- }
-}
-
-function words($str)
-{
- $str = stripslashes($str);
- $list = array();
-
- preg_match_all("/\"([^\"]+)\"/", $str, $regs);
- foreach ($regs[1] as $word)
- {
- $word = addslashes($word);
- $list[] = $word;
- $str = preg_replace("/\Q$word\E/", "", $str);
- }
-
- $regs = null;
- preg_match_all("/(\w+)/", $str, $regs);
- foreach ($regs[1] as $word)
- {
- $list[] = addslashes($word);
- }
-
- return $list;
-}
-?>
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/_README.txt b/bundles/org.eclipse.build.tools/scripts_rss/_README.txt
deleted file mode 100644
index 10095c4..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/_README.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-These scripts are examples to get you started.
-
-== Assembly ==
-
-To build the feedTools.jar, use buildFeedToolsJar.sh (or .xml).
-To create a zip of all the RSS-related code, use buildFeedToolsZip.sh (or .xml).
-
-== Feed Manipulation ==
-
-To do feed manipulation, like creating a feed, adding a entry to a feed, querying
-for attribute values in a feed, or changing attribute values in a feed, look at
-feedManipulation.sh (and .xml) and create a copy similar to suit your needs.
-
-== Feed Publishing ==
-
-To publish a feed, use a script similar to feedPublish.sh (and .xml).
-
-== Feed Validation ==
-
-To validate a feed against the latest schema, you can use one of two EMF-based ant tasks.
-Examples of both are shown in feedValidate.xml, including the classpath required to run the task.
-In the Dynamic case, the schema is used to validate the feed xml; in the Generated case, the
-schema is used to create an .ecore model, which is used to generate model implementation and
-validation code, which is then used to validate the feed xml. Because the two techniques yield
-slightly different error messages when validating invalid feed data, they are both provided for
-comparison.
-
-To build the feedValidator.jar, use buildFeedValidatorJar.xml.
-
-== Feed Watching (And Response) ==
-
-To watch a feed for changes or the appearance of specific attribute values (like
-test results), use a script similar to feedWatch.sh (and .xml), along with properties
-like those in properties/feedWatch.*.properties
-
-The script sendEmailAlert.sh is provided as an example of what to in response to
-a feed change. You can customize the response to suit your needs.
-
-Additional documentation can be found in the *.xml Ant scripts and *.properties files.
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsJar.sh b/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsJar.sh
deleted file mode 100644
index 9ac7c99..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsJar.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 2005, 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
-#*******************************************************************************
-#!/bin/sh
-
-export JAVA_HOME=/opt/sun-java2-5.0;
-export ANT_HOME=/opt/apache-ant-1.6;
-$ANT_HOME/bin/ant -f buildFeedToolsJar.xml;
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsJar.xml b/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsJar.xml
deleted file mode 100644
index f077101..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsJar.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Build feedTools.jar" default="buildFeedToolsJar" basedir="../">
- <target name="buildFeedToolsJar">
- <echo message="Compiling feedTools ..."/>
- <delete file="feedTools.jar"/>
- <delete dir="bin/"/>
- <mkdir dir="bin"/>
- <javac
- source="1.5"
- target="1.5"
- srcdir="."
- destdir="bin/"
- classpath="/lib/ant.jar"
- includes="src_rss/**/*"
- excludes="src_rss/**/emf/*, src_rss/**/emf/**, src_rss/**/emf/**/*"/>
- <echo message="Jarring feedTools.jar ..."/>
- <jar
- destfile="feedTools.jar"
- includes="**/*.class"
- basedir="bin"
- update="true"/>
- <jar
- destfile="feedTools.jar"
- includes="**/messages.properties"
- excludes="**/emf/messages.properties"
- basedir="src_rss"
- update="true"/>
- </target>
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsZip.sh b/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsZip.sh
deleted file mode 100644
index 66df7aa..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsZip.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 2005, 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
-#*******************************************************************************
-#!/bin/sh
-
-export JAVA_HOME=/opt/sun-java2-5.0;
-export ANT_HOME=/opt/apache-ant-1.6;
-$ANT_HOME/bin/ant -f buildFeedToolsZip.xml;
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsZip.xml b/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsZip.xml
deleted file mode 100644
index 78db396..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedToolsZip.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Build feedTools.zip" default="buildFeedToolsZip" basedir="../">
- <target name="buildFeedToolsZip">
- <property name="zipfile" value="org.eclipse.build.tools_feedTools.zip"/>
- <ant antfile="scripts_rss/buildFeedToolsJar.xml" target="buildFeedToolsJar" inheritall="true"/>
- <echo message="Bundling ${zipfile} ..."/>
- <delete file="${zipfile}"/>
- <zip
- destfile="${zipfile}"
- includes=".classpath, .project,
- feedTools.jar,
- src_rss/**/*,
- scripts_rss/**/*,
- schema/**/*,
- data/**/*,
- properties/feedPublish.*.properties,
- properties/feedWatch.*.properties,
- properties/_README.txt"
- basedir="."
- update="true"/>
- </target>
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedValidatorJar.xml b/bundles/org.eclipse.build.tools/scripts_rss/buildFeedValidatorJar.xml
deleted file mode 100644
index b3a1c03..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/buildFeedValidatorJar.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<project name="Build feedValidator.jar" default="buildFeedValidatorJar" basedir="../">
- <target name="buildFeedValidatorJar">
- <!-- TODO: set correct path to EMF plugins -->
- <property name="EMF_HOME" value="../../eclipse-plugins-emf22/eclipse/plugins"/>
- <echo message="Using EMF_HOME = ${EMF_HOME}"/>
-
- <echo message="Compiling feedValidator (requires EMF) ..."/>
- <delete file="feedValidator.jar"/>
- <delete dir="bin_emf/"/>
- <mkdir dir="bin_emf"/>
- <javac
- srcdir="."
- destdir="bin_emf/"
- includes="src_rss/**/emf/*, src_rss/**/emf/**, src_rss/**/emf/**/*">
- <classpath>
- <path path="/lib/ant.jar"></path>
- <fileset dir="${EMF_HOME}">
- <include name="org.eclipse.emf.common_*.jar"/>
- <include name="org.eclipse.emf.ecore_*.jar"/>
- <include name="org.eclipse.emf.ecore.xmi_*.jar"/>
- <include name="org.eclipse.xsd_*.jar"/>
- </fileset>
- </classpath>
- </javac>
- <echo message="Jarring feedValidator.jar ..."/>
- <jar
- destfile="feedValidator.jar"
- basedir="bin_emf"
- update="true"/>
- <jar
- destfile="feedValidator.jar"
- includes="**/emf/messages.properties"
- basedir="src_rss"
- update="true"/>
- <delete dir="bin_emf/"/>
- </target>
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/feedManipulation.sh b/bundles/org.eclipse.build.tools/scripts_rss/feedManipulation.sh
deleted file mode 100644
index 3dd3409..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/feedManipulation.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 2005, 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
-#*******************************************************************************
-#!/bin/sh
-
-export JAVA_HOME=/opt/sun-java2-5.0;
-export ANT_HOME=/opt/apache-ant-1.6;
-
-#ant standalone
-
-CLASSPATH="$JAVA_HOME/lib/rt.jar";
-# note that com.sun.org.apache.xerces (Sun JDK 1.5, rt.jar) != org.apache.xerces (Ant 1.6.5, xercesImpl.jar) so must remove from classpath
-#for f in `find $ANT_HOME/lib -maxdepth 1 -name "*.jar" -type f -not -name "xercesImpl.jar"`; do CLASSPATH=$CLASSPATH":"$f; done
-CLASSPATH=$CLASSPATH":"$ANT_HOME/lib/ant.jar":"$ANT_HOME/lib/ant-launcher.jar;
-
-cmd="$JAVA_HOME/bin/java \
- -Dant.home=$ANT_HOME \
- -Dant.library.dir=$JAVA_HOME/lib \
- -classpath $CLASSPATH \
- org.apache.tools.ant.launch.Launcher \
- -buildfile feedManipulation.xml";
-
-echo "Running ..."; echo "";
-
-#prettyprint the command
-echo $cmd | sed -e 's/ \-/\n \-/g' -e 's/:/\n :/g'; echo "";
-
-# run the command
-$cmd;
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/feedManipulation.xml b/bundles/org.eclipse.build.tools/scripts_rss/feedManipulation.xml
deleted file mode 100644
index cf0862d..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/feedManipulation.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Create Feed, Add Entry, Update Entry, Read Entry" default="doAll">
-
- <taskdef name="CreateFeed" classname="org.eclipse.releng.generators.rss.RSSFeedCreateFeedTask" classpath="../feedTools.jar"/>
- <taskdef name="AddEntry" classname="org.eclipse.releng.generators.rss.RSSFeedAddEntryTask" classpath="../feedTools.jar"/>
- <taskdef name="GetProperty" classname="org.eclipse.releng.generators.rss.RSSFeedGetPropertyTask" classpath="../feedTools.jar"/>
- <taskdef name="UpdateEntry" classname="org.eclipse.releng.generators.rss.RSSFeedUpdateEntryTask" classpath="../feedTools.jar"/>
-
- <target name="doAll">
- <antcall target="addEntry"/>
- <antcall target="getProperties"/>
- <antcall target="updateFeed"/>
- </target>
-
- <target name="init">
- <!-- 1. Define property file -->
-
- <property file="../properties/feedPublish.eclipse.properties"/>
- <!--
- <property file="../properties/feedPublish.emf.properties"/>
- <property file="../properties/feedPublish.uml2.properties"/>
- -->
- </target>
-
- <target name="create" depends="init">
- <!-- 2. Create feed (overwrite existing) -->
-
- <CreateFeed
- debug="${debug}"
- project="${project}"
- file="${file}"
- feedURL="${feedURL}"/>
-
- </target>
-
- <target name="addEntry" depends="init">
- <!-- 3. Add an entry (and create the feed if it doesn't already exist) -->
-
- <!-- note: if not providing a buildType, must specify buildID to generate value -->
- <AddEntry
- debug="${debug}"
- file="${file}"
-
- project="${project}"
- version="${version}"
- branch="${branch}"
- buildID="${buildID}"
- buildType="${buildType}"
- feedURL="${feedURL}"
- buildURL="${buildURL}"
-
- buildAlias="${buildAlias}"
-
- buildDetailURL="${buildDetailURL}"
- buildConfigURL="${buildConfigURL}"
- buildLogURL="${buildLogURL}"
- buildMapURL="${buildMapURL}"
-
- dependencyURLs="${dependencyURLs}"
- releases="${Releases}"
-
- releaseNotesURL="${releaseNotesURL}"
- updateManagerURL="${updateManagerURL}"
- downloadsURL="${downloadsURL}"
- jarSigningStatus="${jarSigningStatus}"
- coordinatedstatus="${coordinatedStatus}"
-
- JUnitTestURL="${JUnitTestURL}"
- performanceTestURL="${performanceTestURL}"
- APITestURL="${APITestURL}"
- JUnitTestResults="${JUnitTestResults}"
- performanceTestResults="${performanceTestResults}"
- APITestResults="${APITestResults}"
- />
-
- </target>
-
- <target name="getProperties" depends="init">
- <!-- 4. Display a text or attribute value (ie., get a property) -->
-
- <!-- on the feed itself, display modified date -->
- <GetProperty
- debug="${debug}"
- file="${file}"
- xpath="/*[name() = 'feed']/*[name() = 'updated']/text()"
- />
-
- <!-- on the first entry, display the modified date -->
- <GetProperty
- debug="${debug}"
- file="${file}"
- xpath="/*/*[name() = 'entry'][1]/*[name() = 'updated']/text()"
- />
-
- <!-- on the first entry, display the build's folder, filename, and type -->
- <GetProperty
- file="${file}"
- xpath="/*/*[name() = 'entry'][1]/*/*[name() = 'build']/@href"
- />
- <GetProperty
- file="${file}"
- xpath="/*/*[name() = 'entry'][1]/*/*[name() = 'build']/*[name() = 'releases']/*[@os = 'linux'][@ws = 'gtk'][@type = 'SDK']/text()"
- />
- <GetProperty
- file="${file}"
- xpath="/*/*[name() = 'entry'][1]/*/*[name() = 'build']/@type"
- />
-
- </target>
-
- <target name="updateFeed" depends="init">
- <!-- 5. Update an existing entry by changing a property value to something else -->
-
- <!-- on the first entry, change the coordinated status to COMPLETE -->
- <UpdateEntry
- file="${file}"
- xpath="/*/*[name() = 'entry'][1]/*/*/*[name() = 'coordinated']/@status"
- replacement="COMPLETE"
- />
- <!-- on the first entry, change the performance results (os-ws = RHEL4-3GHz-2.5GB-gtk) to PENDING -->
- <UpdateEntry
- file="${file}"
- xpath="/*/*[name() = 'entry'][1]/*/*/*/*[@type = 'performance']/*[name() = 'result'][@id = 'RHEL4-3GHz-2.5GB']/text()"
- replacement="PENDING"
- />
-
- </target>
-
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/feedManipulationEclipse.sh b/bundles/org.eclipse.build.tools/scripts_rss/feedManipulationEclipse.sh
deleted file mode 100644
index 7846332..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/feedManipulationEclipse.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 2005, 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
-#*******************************************************************************
-#!/bin/sh
-
-export JAVA_HOME=/opt/sun-java2-5.0;
-export ANT_HOME=/opt/apache-ant-1.6;
-export ECLIPSE_HOME=/home/eclipse/eclipse;
-
-#ant with Eclipse - requires org.eclipse.ant.ui*.jar
-tmpfolder="/tmp/antrunner-"`date +%Y%m%d_%H%M%S`;
-for f in `find $ECLIPSE_HOME/plugins -maxdepth 1 -name "org.eclipse.ant.ui*.jar" -type f`; do unzip $f lib/*.jar -d $tmpfolder; done
-
-CLASSPATH="$JAVA_HOME/lib/rt.jar";
-for d in "$ANT_HOME/lib" "$tmpfolder/lib"; do
- # note that com.sun.org.apache.xerces (Sun JDK 1.5, rt.jar) != org.apache.xerces (Ant 1.6.5, xercesImpl.jar) so must remove from classpath
- for f in `find $d -maxdepth 1 -name "*.jar" -type f -not -name "xercesImpl.jar"`; do CLASSPATH=$CLASSPATH":"$f; done
-done
-
-cmd="$JAVA_HOME/bin/java \
- -Dant.home=$ANT_HOME \
- -Dant.library.dir=$ANT_HOME/lib \
- -classpath $CLASSPATH \
- org.eclipse.ant.internal.ui.antsupport.InternalAntRunner \
- -buildfile feedManipulation.xml";
-
-echo "Running ...";
-
-#prettyprint the command
-echo $cmd | sed -e 's/ \-/\n \-/g' -e 's/:/\n :/g'; echo "";
-
-# run the command
-$cmd;
-
-rm -fr $tmpfolder;
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/feedPublish.sh b/bundles/org.eclipse.build.tools/scripts_rss/feedPublish.sh
deleted file mode 100644
index e0d74d2..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/feedPublish.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 2005, 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
-#*******************************************************************************
-#!/bin/sh
-
-###
-### NOTE: this script is ONLY an example, and needs to be customized for your personal use. ###
-###
-
-export JAVA_HOME=/opt/sun-java2-5.0;
-export ANT_HOME=/opt/apache-ant-1.6;
-CLASSPATH="$JAVA_HOME/lib/rt.jar";
-CLASSPATH=$CLASSPATH":"$ANT_HOME/lib/ant.jar":"$ANT_HOME/lib/ant-launcher.jar;
-CLASSPATH=$CLASSPATH":"../feedTools.jar;
-
-projectName="emf";
-
-# define/override variables not set in properties file (can also be passed in querystring, etc.)
-# this allows a static set of properties + some dynamic ones to be mixed in together
-debug=2;
-branch="HEAD"; # optional
-version="2.2.1";
-buildID="S200609210005";
-buildAlias="2.2.1RC2";
-dependencyURLs="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/M20060919-1045/eclipse-SDK-M20060919-1045-linux-gtk.tar.gz"; # comma-separated if more than one
-# ...
-
-cmd="$JAVA_HOME/bin/java -debug -Dant.home=$ANT_HOME -Dant.library.dir=$JAVA_HOME/lib -classpath $CLASSPATH org.apache.tools.ant.launch.Launcher"
-cmd=$cmd" -buildfile feedPublish.xml -propertyfile ../properties/feedPublish.$projectName.properties"
-cmd=$cmd" -Dbranch=$branch -Dversion=$version -DbuildID=$buildID -DbuildAlias=$buildAlias -DbuildType="${buildID:0:1};
-cmd=$cmd" -DdependencyURLs=$dependencyURLs -Ddebug=$debug";
-echo ""; echo $cmd | sed -e "s/ \-/# \-/g" -e "s/.jar:/.jar# :/g" | tr "#" "\n"; echo "";
-$cmd;
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/feedPublish.xml b/bundles/org.eclipse.build.tools/scripts_rss/feedPublish.xml
deleted file mode 100644
index 5204db3..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/feedPublish.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Create/Update + Publish Feed" default="publishFeed" basedir="..">
- <taskdef name="PublishFeed" classname="org.eclipse.releng.services.rss.RSSFeedPublisherTask" classpath="./feedTools.jar"/>
- <taskdef name="AddEntry" classname="org.eclipse.releng.generators.rss.RSSFeedAddEntryTask" classpath="./feedTools.jar"/>
- <!-- to run from a shell, modify feedPublish.sh to suit your needs -->
-
- <target name="publishFeed">
- <!-- TODO: include properties file here if not running from a shell script -->
- <property file="properties/feedPublish.emf.properties"/>
- <antcall target="addEntry"/>
- <antcall target="publishFeedToCVS"/>
- <antcall target="publishFeedWithSCP"/>
- </target>
-
- <target name="addEntry">
- <!-- 1. Add an entry (and create the feed if it doesn't already exist) -->
- <AddEntry
- debug="${debug}"
- file="${file}"
-
- project="${project}"
- version="${version}"
- branch="${branch}"
- buildID="${buildID}"
- buildtype="${buildType}"
- feedURL="${feedURL}"
- buildURL="${buildURL}"
-
- buildAlias="${buildAlias}"
-
- buildDetailURL="${buildDetailURL}"
- buildConfigURL="${buildConfigURL}"
- buildLogURL="${buildLogURL}"
- buildMapURL="${buildMapURL}"
-
- dependencyURLs="${dependencyURLs}"
- releases="${Releases}"
-
- releaseNotesURL="${releaseNotesURL}"
- updateManagerURL="${updateManagerURL}"
- downloadsURL="${downloadsURL}"
- jarSigningStatus="${jarSigningStatus}"
- coordinatedStatus="${coordinatedStatus}"
- coordinatedDetails="${coordinatedDetails}"
-
- JUnitTestURL="${JUnitTestURL}"
- performanceTestURL="${performanceTestURL}"
- APITestURL="${APITestURL}"
- JUnitTestResults="${JUnitTestResults}"
- performanceTestResults="${performanceTestResults}"
- APITestResults="${APITestResults}"
- />
- </target>
-
- <!-- 2. Publish feed: commit file into CVS - overwrite existing and add if necessary -->
- <target name="publishFeedToCVS">
- <PublishFeed
- debug="${debug}"
- file="${file}"
-
- cvsExec="${cvsExec}"
- cvsRoot="${cvsRoot}"
- cvsPath="${cvsPath}"
- cvsTemp="${cvsTemp}"
- />
- <delete dir="${cvsTemp}"/>
- </target>
-
- <!-- 3. Publish feed: SCP file to remote server, overwriting existing if exists -->
- <target name="publishFeedWithSCP">
- <PublishFeed
- debug="${debug}"
- file="${file}"
-
- scpExec="${scpExec}"
- scpTarget="${scpTarget}"
- sshExec="${sshExec}"
- />
- </target>
-
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/feedValidate.xml b/bundles/org.eclipse.build.tools/scripts_rss/feedValidate.xml
deleted file mode 100644
index 351889d..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/feedValidate.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Validate a Feed" default="validateFeed" basedir="../">
- <!-- TODO: set correct path to EMF plugins -->
- <property name="EMF_HOME" value="../../eclipse-plugins-emf22/eclipse/plugins"/>
- <echo message="Using EMF_HOME = ${EMF_HOME}"/>
-
- <taskdef name="validateFeed"
- classname="org.eclipse.releng.util.rss.emf.RSSFeedValidatorDynamicTask">
- <classpath>
- <pathelement path="feedValidator.jar"/>
- <fileset dir="${EMF_HOME}">
- <include name="**/org.eclipse.emf.ecore_*.jar"/>
- <include name="**/org.eclipse.emf.common_*.jar"/>
- <include name="**/org.eclipse.emf.ecore.xmi_*.jar"/>
- <include name="**/org.eclipse.xsd_*.jar"/>
- </fileset>
- </classpath>
- </taskdef>
-
- <!-- debug: 0|1|2 -->
- <target name="validateFeed" description="verify if the feed is valid with respect to the schema">
- <validateFeed
- debug="2"
- XSDFile="../schema/atom10_build.xsd"
- XMLFile="../data/builds-emf.xml" >
- </validateFeed>
- </target>
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/feedWatch.sh b/bundles/org.eclipse.build.tools/scripts_rss/feedWatch.sh
deleted file mode 100644
index 631539c..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/feedWatch.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 2005, 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
-#*******************************************************************************
-#!/bin/sh
-
-export JAVA_HOME=/opt/sun-java2-5.0;
-export ANT_HOME=/opt/apache-ant-1.6;
-$ANT_HOME/bin/ant -f feedWatch.xml;
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/feedWatch.xml b/bundles/org.eclipse.build.tools/scripts_rss/feedWatch.xml
deleted file mode 100644
index 9494d05..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/feedWatch.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="Watch Feed" default="watchFeed">
-
- <taskdef name="WatchFeed"
- classname="org.eclipse.releng.services.rss.RSSFeedWatcherTask"
- classpath="../feedTools.jar"/>
-
- <!-- 1. Define property file -->
- <target name="init">
- <!-- <property file="../properties/feedWatch.emf.properties"/> -->
- <property file="../properties/feedWatch.uml2.properties"/>
- </target>
-
- <!-- 2. Watch feed for certain change conditions and respond if necessary -->
- <target name="watchFeed" depends="init" description="Watch feed for certain change conditions and respond if necessary">
- <WatchFeed
- debug="${debug}"
- file="${file}"
- feedURL="${feedURL}"
- feedWatchActions="${feedWatchActions}"
- />
-
- <!--
- Different ways to get at the results of the task include:
-
- feedWatchAction.Result.0 - The result returned from the <exec> task; if set, something bad happened
- feedWatchAction.Error.0 - Details about the error that occurred, if set, something bad happened
- feedWatchAction.Output.0 - Console output from your <exec>, if any;
- this will depend on what you run in response to a feed change, and if that process produces console output
- feedWatchAction.OldValue.0 - The original value of the node you asked for, from the previous cached version of the feed
- feedWatchAction.NewValue.0 - The changed value of the node you asked for, from the latest version of the feed;
- if you asked for changes to the test status for performance tests, this could be "PASS";
- if you asked for any changes to the feed, this will be the XML datestamp of the last update, eg: 2006-05-04T12:14:33Z
- feedWatchAction.TheValue.0 - Even if the original value is unchanged, this will contain the NewValue.
- This is useful to determine if the value changed (check if NewValue.0 is defined), but also to have the value,
- in case you need to pass it to a downstream script. For example, you can check //*[name()='entry'][1]/*/*[name()='build']/@type - which
- if the feed only contains S builds, will never change, and NewValue.0 will be undefined; however, you need the "S" value,
- so use this property instead of NewValue.0 in order to pass it to the next script.
-
- If you are watching for more than one condition, you can check for feedWatchAction.NewValue.0, feedWatchAction.NewValue.1, feedWatchAction.NewValue.2, etc.
- -->
-
- <!--
- <echoproperties format="text">
- <propertyset><propertyref regex="feedWatchAction\.(Result|Error|Output|NewValue|OldValue|TheValue)\.0"/></propertyset>
- </echoproperties>
- -->
-
- <echo message="feedWatchAction.OldValue.0 = ${feedWatchAction.OldValue.0}"/>
- <echo message="feedWatchAction.NewValue.0 = ${feedWatchAction.NewValue.0}"/>
- <echo message="feedWatchAction.TheValue.0 = ${feedWatchAction.TheValue.0}"/>
- <echo message="feedWatchAction.OldValue.1 = ${feedWatchAction.OldValue.1}"/>
- <echo message="feedWatchAction.NewValue.1 = ${feedWatchAction.NewValue.1}"/>
- <echo message="feedWatchAction.TheValue.1 = ${feedWatchAction.TheValue.1}"/>
- <echo message="feedWatchAction.OldValue.2 = ${feedWatchAction.OldValue.2}"/>
- <echo message="feedWatchAction.NewValue.2 = ${feedWatchAction.NewValue.2}"/>
- <echo message="feedWatchAction.TheValue.2 = ${feedWatchAction.TheValue.2}"/>
-
- <!-- 3. now we can respond to a changed/unchanged condition if desired -->
- <antcall target="respondToFeedUnchanged"/>
- <antcall target="respondToFeedChanged"/>
-
- </target>
-
- <!-- 3a. If not responding via shell <exec>, respond now by checking property(ies) for results -->
- <target name="respondToFeedUnchanged" description="Respond to feed unchanged" unless="feedWatchAction.NewValue.0">
- <echo message="Feed unchanged! Should we do something, like waiting for some period of time and trying again?"/>
- <!-- add steps to do here, like sleeping & re-firing, sending a nag note to someone, etc. -->
- </target>
- <!-- 3b. If not responding via shell <exec>, respond now by checking property(ies) for results -->
- <target name="respondToFeedChanged" description="Respond to feed changed" if="feedWatchAction.NewValue.0">
- <echo message="Feed changed! Time to do something... but what?"/>
- <!-- add steps to do here, like firing an email, starting a build, etc. -->
-
- <!-- eg., wait 30 seconds and try again -->
- <!-- <echo message="Sleeping..."/>
- <exec executable="sleep" resolveexecutable="true"><arg line="10"/></exec>
- <echo message="Spawning..."/>
- <exec executable="feedWatch.sh" resolveexecutable="true" spawn="true"/> -->
- </target>
-
-</project>
diff --git a/bundles/org.eclipse.build.tools/scripts_rss/sendEmailAlert.sh b/bundles/org.eclipse.build.tools/scripts_rss/sendEmailAlert.sh
deleted file mode 100644
index 3906f9d..0000000
--- a/bundles/org.eclipse.build.tools/scripts_rss/sendEmailAlert.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 2005, 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
-#*******************************************************************************
-#!/bin/sh
-
-# simple sample script to fire an email from the local machine to some user to
-# notify them of a change to the watched feed
-
-# Requirements:
-# tested on Debian (Kubuntu), using
-# exim 3.36-16
-# mailx 1:8.1.2-0.20040524cvs-4
-
-debug=0;
-feedURL="";
-xpath="";
-newvalue="";
-oldvalue="";
-
-while [ "$#" -gt 0 ]; do
- case $1 in
- '-debug')
- debug=$2;
- shift 1
- ;;
- '-feedURL')
- feedURL=$2;
- shift 1
- ;;
- '-xpath')
- xpath=$2;
- shift 1
- ;;
- '-oldvalue')
- oldvalue=$2;
- shift 1
- ;;
- '-newvalue')
- newvalue=$2;
- shift 1
- ;;
- esac
- shift 1
-done
-
-if [ $debug -gt 0 ]; then
- echo "[sendEmailAlert] Started `date +%H:%M:%S`. Executing with the following options:"
- echo "-debug $debug";
- echo "-feedURL $feedURL";
- echo "-xpath $xpath";
- echo "-oldvalue $oldvalue";
- echo "-newvalue $newvalue";
-fi
-
-tmpfile="/tmp/sendEmailAlert.sh.tmp";
-echo "" > $tmpfile;
-
-# compose message
-echo "Eclipse RSS Feed has been updated." >> $tmpfile;
-echo "" >> $tmpfile;
-echo "Here's what happened:" >> $tmpfile;
-echo "" >> $tmpfile;
-
-if [ "x$xpath" != "x" ]; then echo "Changed Node: "$xpath >> $tmpfile; fi
-if [ "x$oldvalue" != "x" ]; then echo "Old Value: "$oldvalue >> $tmpfile; fi
-if [ "x$newvalue" != "x" ]; then echo "New Value: "$newvalue >> $tmpfile; fi
-if [ "x$feedURL" != "x" ]; then echo "Feed URL: "$feedURL >> $tmpfile; fi
-
-echo "" >> $tmpfile;
-
-#assemble mail info
-toAddress="codeslave@ca.ibm.com";
-fromAddress="Eclipse Build Team <NOSUCHADDRESS@eclipse.org>";
-subject="Eclipse RSS Feed Updated!";
-MAIL="/usr/bin/mail";
-
-if [ $debug -gt 0 ]; then
- echo "Sending the following email using "$MAIL":";
- echo "--";
- echo "Subject: "$subject;
- echo "To: "$toAddress
- echo "From: "$fromAddress
- echo "--";
- cat $tmpfile;
- echo "--";
-fi
-
-# send message
-cat $tmpfile | $MAIL -s "$subject" -a "From: $fromAddress" $toAddress;
-
-# cleanup
-rm -fr $tmpfile;
-
-if [ $debug -gt 0 ]; then
- echo "Done.";
-fi
diff --git a/bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java b/bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java
index 7713c85..36a527f 100644
--- a/bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java
+++ b/bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java
@@ -10,11 +10,34 @@
*******************************************************************************/
package org.eclipse.releng.generators;
-import java.io.*;
-import java.util.*;
-import javax.xml.parsers.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.tools.ant.Task;
-import org.w3c.dom.*;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
diff --git a/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/services/bugzilla/UpdateBugStateTask.java b/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/services/bugzilla/UpdateBugStateTask.java
deleted file mode 100644
index 5e120cb..0000000
--- a/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/services/bugzilla/UpdateBugStateTask.java
+++ /dev/null
@@ -1,706 +0,0 @@
-/**
- * Copyright (c) 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
- */
-
-package org.eclipse.releng.services.bugzilla;
-
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.net.ssl.HttpsURLConnection;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-import org.eclipse.releng.util.bugzilla.Messages;
-
-
-public class UpdateBugStateTask extends Task
-{
- private static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
-
- private static final String GET = "GET"; //$NON-NLS-1$
-
- private static final String CTYPE_RDF = "&ctype=rdf"; //$NON-NLS-1$
-
- private static final String URL_TARGET_MILESTONE = "&target_milestone="; //$NON-NLS-1$
-
- private static final String URL_CHFIELDTO = "&chfieldto="; //$NON-NLS-1$
-
- private static final String URL_BUG_STATUS = "&bug_status="; //$NON-NLS-1$
-
- private static final String HTTPS_BUGS_ECLIPSE_ORG_BUGS_BUGLIST_CGI_PRODUCT = "https://bugs.eclipse.org/bugs/buglist.cgi?product="; //$NON-NLS-1$
-
- private static final String COOKIE = "Cookie"; //$NON-NLS-1$
-
- private static final String APPLICATION_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$
-
- private static final String CONTENT_TYPE = "Content-type"; //$NON-NLS-1$
-
- private static final String POST = "POST"; //$NON-NLS-1$
-
- private static final String HTTPS_BUGS_ECLIPSE_ORG_BUGS_PROCESS_BUG_CGI = "https://bugs.eclipse.org/bugs/process_bug.cgi"; //$NON-NLS-1$
-
- private static final String BUG_STATUS = "bug_status"; //$NON-NLS-1$
-
- private static final String AMP = "&"; //$NON-NLS-1$
-
- private static final String EQ = "="; //$NON-NLS-1$
-
- private static final String HTTPS_BUGS_ECLIPSE_ORG_BUGS_SHOW_BUG_CGI_ID = "https://bugs.eclipse.org/bugs/show_bug.cgi?id="; //$NON-NLS-1$
-
- private static final String CTYPE_XML = "&ctype=xml"; //$NON-NLS-1$
-
- private static final String RESOLVE = "resolve"; //$NON-NLS-1$
-
- private static final String RESOLUTION = "resolution"; //$NON-NLS-1$
-
- private static final String KNOB = "knob"; //$NON-NLS-1$
-
- private static final String LONGDESCLENGTH = "longdesclength"; //$NON-NLS-1$
-
- private static final String SHORT_DESC = "short_desc"; //$NON-NLS-1$
-
- private static final String BUG_FILE_LOC = "bug_file_loc"; //$NON-NLS-1$
-
- private static final String BUG_SEVERITY = "bug_severity"; //$NON-NLS-1$
-
- private static final String PRIORITY = "priority"; //$NON-NLS-1$
-
- private static final String OP_SYS = "op_sys"; //$NON-NLS-1$
-
- private static final String REP_PLATFORM = "rep_platform"; //$NON-NLS-1$
-
- private static final String TARGET_MILESTONE = "target_milestone"; //$NON-NLS-1$
-
- private static final String COMPONENT = "component"; //$NON-NLS-1$
-
- private static final String VERSION = "version"; //$NON-NLS-1$
-
- private static final String PRODUCT = "product"; //$NON-NLS-1$
-
- private static final String ID = "id"; //$NON-NLS-1$
-
- private static final String COMMENT = "comment"; //$NON-NLS-1$
-
- private static final String PROCESS_BUG = "process_bug"; //$NON-NLS-1$
-
- private static final String FORM_NAME = "form_name"; //$NON-NLS-1$
-
- private static final String BUGZILLA_LOGINCOOKIE = "; Bugzilla_logincookie="; //$NON-NLS-1$
-
- private static final String BUGZILLA_LOGIN = "Bugzilla_login="; //$NON-NLS-1$
-
- private static final String DIGITS_REGEX = "(\\d+)"; //$NON-NLS-1$
-
- private static final String COLON = ":"; //$NON-NLS-1$
-
- private static final String DASH = "-"; //$NON-NLS-1$
-
- private static final String BUGID_REGEX = "<bz:id(?: nc:parseType=\"Integer\")>(\\d+)</bz:id>"; //$NON-NLS-1$
-
- private static final String BUILDID_REGEX = "([IMNRS]?-?)(\\d{4})(\\d{2})(\\d{2})-?(\\d{2})(\\d{2})"; //$NON-NLS-1$
-
- private static final String TIMESTAMP_REGEX = "(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})"; //$NON-NLS-1$
-
- private static final String JS = "Java said:"; //$NON-NLS-1$
-
- private static final String SP = " "; //$NON-NLS-1$
-
- private static final String XML_REGEX = "<(\\S+)>([^<]+)</\\1>"; //$NON-NLS-1$
-
- private static final String NL = "\n"; //$NON-NLS-1$
-
- private static final String CSO = ", or "; //$NON-NLS-1$
-
- private static final String CS = ", "; //$NON-NLS-1$
-
- private static final String BZ_IV = "INVALID"; //$NON-NLS-1$
-
- private static final String BZ_WF = "WONTFIX"; //$NON-NLS-1$
-
- private static final String BZ_LT = "LATER"; //$NON-NLS-1$
-
- private static final String BZ_RM = "REMIND"; //$NON-NLS-1$
-
- private static final String BZ_WK = "WORKSFORME"; //$NON-NLS-1$
-
- private static final String BZ_FX = "FIXED"; //$NON-NLS-1$
-
- private static final String BZ_RE = "REOPENED"; //$NON-NLS-1$
-
- private static final String BZ_AS = "ASSIGNED"; //$NON-NLS-1$
-
- private static final String BZ_NEW = "NEW"; //$NON-NLS-1$
-
- private static final String BZ_UC = "UNCONFIRMED"; //$NON-NLS-1$
-
- private static final String EMPTY = ""; //$NON-NLS-1$
-
- private static final String LT = "<"; //$NON-NLS-1$
-
- private static final String GT = ">"; //$NON-NLS-1$
-
- private static final String QUOT = "\""; //$NON-NLS-1$
-
- private static final String APOS = "'"; //$NON-NLS-1$
-
- private static final String HTML_APOS = "'"; //$NON-NLS-1$
-
- private static final String HTML_QUOT = """; //$NON-NLS-1$
-
- private static final String HTML_LT = "<"; //$NON-NLS-1$
-
- private static final String HTML_GT = ">"; //$NON-NLS-1$
-
- private static final String HTML_NBSP = " "; //$NON-NLS-1$
-
- private static final String HTML_AMP = "&"; //$NON-NLS-1$
-
- private int debug;
-
- private int login;
-
- private int loginCookie;
-
- private String product;
-
- private String status;
-
- private String buildID;
-
- private String buildAlias;
-
- private String milestone;
-
- private String bugList;
-
- private String resolution;
-
- private String endDate;
-
- private LinkedHashMap trans;
-
- public UpdateBugStateTask()
- {
- debug = 1;
-
- login = 0;
- loginCookie = 0;
- product = EMPTY;
- status = EMPTY;
- buildID = EMPTY;
- buildAlias = EMPTY;
- endDate = EMPTY;
- milestone = EMPTY;
- bugList = EMPTY;
- resolution = BZ_FX;
-
- trans = new LinkedHashMap(8, 0.75f, false);
- trans.put(HTML_APOS, APOS);
- trans.put(HTML_QUOT, QUOT);
- trans.put(HTML_LT, LT);
- trans.put(HTML_GT, GT);
- trans.put(HTML_NBSP, SP);
- trans.put(HTML_AMP, AMP);
- }
-
- public void setDebug(int d)
- {
- debug = d;
- }
-
- public void setBugList(String b)
- {
- bugList = b;
- }
-
- public void setProduct(String p)
- {
- product = p;
- }
-
- public void setStatus(String s)
- {
- if (s.equals(BZ_UC) || s.equals(BZ_NEW) || s.equals(BZ_AS) || s.equals(BZ_RE))
- {
- status = s;
- }
- else
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.invalidStatus") + "!" + SP + //$NON-NLS-1$ //$NON-NLS-2$
- Messages.getString("UpdateBugStateTask.expectedOne") + SP + BZ_UC + CS + BZ_NEW + CS + BZ_AS + CSO + BZ_RE); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- public void setLogin(int l)
- {
- login = l;
- }
-
- public void setLoginCookie(int lc)
- {
- loginCookie = lc;
- }
-
- public void setResolution(String r)
- {
- if (r.equals(BZ_FX) || r.equals(BZ_IV) || r.equals(BZ_WF) || r.equals(BZ_LT) || r.equals(BZ_RM) || r.equals(BZ_WK))
- {
- resolution = r;
- }
- else
- {
- System.err.println(Messages.getString("UpdateBugStateTask.invalidResolution") + "!" + SP + //$NON-NLS-1$ //$NON-NLS-2$
- Messages.getString("UpdateBugStateTask.expected") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + SP + BZ_FX + CS + BZ_IV + CS + BZ_WF + CS + BZ_LT + CS + BZ_RM + CSO + BZ_WK + SP
- + "(" + Messages.getString("UpdateBugStateTask.default") + COLON + SP + BZ_FX + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- public void setEndDate(String t)
- {
- Pattern p = Pattern.compile(TIMESTAMP_REGEX);
- Matcher m = p.matcher(t);
- if (m.matches())
- {
- endDate = m.group(1) + DASH + m.group(2) + DASH + m.group(3) + SP + m.group(4) + COLON + m.group(5);
- }
- else
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.invalidTimestamp") + COLON + SP + t + "!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public void setBuildID(String t)
- {
- Pattern p = Pattern.compile(BUILDID_REGEX);
- Matcher m = p.matcher(t);
- if (m.matches())
- {
- buildID = m.group(1) + m.group(2) + m.group(3) + m.group(4) + m.group(5) + m.group(6);
- }
- else
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.invalidBuildID") + COLON + SP + t + "!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- public void setBuildAlias(String b)
- {
- buildAlias = b;
- }
-
- public void setMilestone(String m)
- {
- milestone = m;
- }
-
-public void execute() throws BuildException
- {
- if (login == 0)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.expectingLogin") + "!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (loginCookie == 0)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.expectingLogincookie") + "!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (status.equals(EMPTY))
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.expectingStatus") + "!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /* we take an explicit list OR do a query, not both */
- if (!bugList.equals(EMPTY) && endDate.equals(EMPTY) && milestone.equals(EMPTY) && product.equals(EMPTY))
- {
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.usingBugList")); //$NON-NLS-1$
- }
- Pattern p = Pattern.compile(DIGITS_REGEX);
- Matcher m = p.matcher(bugList);
- while (m.find())
- {
- int bugID = Integer.parseInt(m.group(1));
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.found") + SP + bugID); //$NON-NLS-1$
- }
- doBug(bugID);
- }
- }
- else if (bugList.equals(EMPTY))
- {
- if (product.equals(EMPTY))
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.expectingProduct") + "!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.queryingFor") + SP + //$NON-NLS-1$
- (!status.equals(EMPTY) ? status + SP : EMPTY) +
- (!product.equals(EMPTY) ? product + SP : EMPTY) +
- (!milestone.equals(EMPTY) ? milestone + SP : EMPTY) +
- Messages.getString("UpdateBugStateTask.bugs")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /* the Bugzilla search form generates a massive URL, but thankfully doesn't
- * demand all sorts of superfluous fields like when updating a bug */
- String url = HTTPS_BUGS_ECLIPSE_ORG_BUGS_BUGLIST_CGI_PRODUCT + urlEncode(product) + URL_BUG_STATUS + urlEncode(status)
- + URL_CHFIELDTO + urlEncode(endDate) + URL_TARGET_MILESTONE + urlEncode(milestone) + CTYPE_RDF;
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.connectingTo") + SP + //$NON-NLS-1$
- url + SP + "..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- HttpsURLConnection bugsconn = getConn(url, GET, true, false, EMPTY);
- String bugs = slurpStream(bugsconn);
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.gotBugList") + COLON); //$NON-NLS-1$
- System.err.println(bugs);
- }
-
- Pattern p = Pattern.compile(BUGID_REGEX);
- Matcher m = p.matcher(bugs);
- if (m.find()) {
- while (m.find())
- {
- int bugID = Integer.parseInt(m.group(1));
- if (debug > 1)
- {
- System.out.println(Messages.getString("UpdateBugStateTask.found") + SP + bugID); //$NON-NLS-1$
- }
- doBug(bugID);
- }
- }
- else
- {
- System.out.println("No bugs found matching specified state" + SP + "(" + status + "). Nothing to do!");
- }
- }
- else
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.ambiguousRequest") + CS + //$NON-NLS-1$
- Messages.getString("UpdateBugStateTask.mutuallyExclusive") + "!"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- } private void doBug(int bugID) throws BuildException
- {
- if (bugID == 0)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.invalidBugID") + SP + bugID + "!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- String bugcookie = BUGZILLA_LOGIN + login + BUGZILLA_LOGINCOOKIE + loginCookie;
- String buildstring = EMPTY;
- if (buildAlias.equals(EMPTY) && buildID.equals(EMPTY))
- {
- buildstring = Messages.getString("UpdateBugStateTask.latestBuild"); //$NON-NLS-1$
- }
- else if (!buildAlias.equals(EMPTY) && !buildID.equals(EMPTY))
- {
- buildstring = buildAlias + SP + "(" + buildID + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else
- {
- buildstring = (!buildAlias.equals(EMPTY) ? buildAlias : buildID);
- }
-
- Hashtable args = new Hashtable();
- args.put(FORM_NAME, PROCESS_BUG);
- args.put(COMMENT, Messages.getString("UpdateBugStateTask.fixedIn") + SP + buildstring + "."); //$NON-NLS-1$ //$NON-NLS-2$
- args.put(ID, new Integer(bugID));
- args.put(PRODUCT, EMPTY);
- args.put(VERSION, EMPTY);
- args.put(COMPONENT, EMPTY);
- args.put(TARGET_MILESTONE, EMPTY);
- args.put(REP_PLATFORM, EMPTY);
- args.put(OP_SYS, EMPTY);
- args.put(PRIORITY, EMPTY);
- args.put(BUG_SEVERITY, EMPTY);
- args.put(BUG_FILE_LOC, EMPTY);
- args.put(SHORT_DESC, EMPTY);
- args.put(LONGDESCLENGTH, new Integer(1)); //Bugzilla doesn't seem to use this, but demands it anyways
- args.put(KNOB, RESOLVE);
- args.put(RESOLUTION, resolution);
-
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.usingCookie") + COLON + SP + bugcookie); //$NON-NLS-1$
- System.err.println(Messages.getString("UpdateBugStateTask.usingComment") + COLON + SP + args.get(COMMENT).toString()); //$NON-NLS-1$
- }
-
- /* slurp xml for bugID */
- String url = HTTPS_BUGS_ECLIPSE_ORG_BUGS_SHOW_BUG_CGI_ID + urlEncode(args.get(ID).toString()) + CTYPE_XML;
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.connectingTo") + SP + //$NON-NLS-1$
- url + SP + "..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- HttpsURLConnection xmlconn = getConn(url, GET, true, false, EMPTY);
- String xml = slurpStream(xmlconn);
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.gotXML") + COLON); //$NON-NLS-1$
- System.err.println(xml);
- }
- xmlconn.disconnect();
-
- /* parse xml, build post string */
- String req = EMPTY;
- Hashtable pxml = parseXML(xml);
- for (Enumeration e = args.keys(); e.hasMoreElements();)
- {
- String elem = e.nextElement().toString();
- /* sometimes Bugzilla omits bug_file_loc if it's blank... */
- if (args.get(elem).equals(EMPTY) && pxml.get(elem) != null)
- {
- args.put(elem, pxml.get(elem));
- }
-
- req += urlEncode(elem) + EQ + urlEncode(args.get(elem).toString()) + AMP;
- }
-
- req = req.substring(0, req.length() - 1);
-
- /* update bug, if applicable */
- if (pxml.get(BUG_STATUS) == null)
- {
- if (debug > 0)
- {
- System.out.println(Messages.getString("UpdateBugStateTask.noBugStatus") + SP + //$NON-NLS-1$
- bugID + CS + Messages.getString("UpdateBugStateTask.missingBug")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- else if (pxml.get(BUG_STATUS).equals(status))
- {
- String bugurl = HTTPS_BUGS_ECLIPSE_ORG_BUGS_PROCESS_BUG_CGI;
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.connectingTo") + SP + //$NON-NLS-1$
- bugurl + SP + "..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- HttpsURLConnection bugconn = getConn(bugurl, POST, true, true, bugcookie);
-
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.postingData") + COLON); //$NON-NLS-1$
- System.err.println(req);
- }
- sendStream(bugconn, req);
- String response = slurpStream(bugconn);
-
- // trap for invalid login cookie
- if (response.indexOf(Messages.getString("UpdateBugStateTask.legitimateLoginAndPassword")) > 0) //$NON-NLS-1$
- {
- System.err.println(Messages.getString("UpdateBugStateTask.couldNotLogIn")); //$NON-NLS-1$
- System.err.println(Messages.getString("UpdateBugStateTask.BugzillaReplied") + COLON + SP + //$NON-NLS-1$
- "\"" + Messages.getString("UpdateBugStateTask.legitimateLoginAndPassword") + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.gotResponse") + COLON); //$NON-NLS-1$
- System.err.println(response);
- }
- bugconn.disconnect();
- System.err.println(Messages.getString("UpdateBugStateTask.setBugFailed") + SP + bugID + SP + //$NON-NLS-1$
- Messages.getString("UpdateBugStateTask.to") + SP + resolution + SP + //$NON-NLS-1$
- "(" + Messages.getString("UpdateBugStateTask.was") + SP + pxml.get(BUG_STATUS) + ")" + COLON + SP + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "\"" + Messages.getString("UpdateBugStateTask.fixedIn") + SP + buildstring + ".\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- else
- {
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.gotResponse") + COLON); //$NON-NLS-1$
- System.err.println(response);
- }
- bugconn.disconnect();
- if (debug > 0)
- {
- System.out.println(Messages.getString("UpdateBugStateTask.setBug") + SP + bugID + SP + //$NON-NLS-1$
- Messages.getString("UpdateBugStateTask.to") + SP + resolution + SP + //$NON-NLS-1$
- "(" + Messages.getString("UpdateBugStateTask.was") + SP + pxml.get(BUG_STATUS) + ")" + COLON + SP + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "\"" + Messages.getString("UpdateBugStateTask.fixedIn") + SP + buildstring + ".\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- }
- else
- {
- if (debug > 0)
- {
- System.out.println(Messages.getString("UpdateBugStateTask.ignoreBug") + SP + args.get(ID).toString() + SP + //$NON-NLS-1$
- "(" + Messages.getString("UpdateBugStateTask.notInExpectedState") + SP + status + ")" + COLON + SP + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Messages.getString("UpdateBugStateTask.was") + SP + pxml.get(BUG_STATUS).toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
- private String urlEncode(String elem)
- {
- elem = htmlDecode(elem);
-
- try
- {
- elem = URLEncoder.encode(elem, UTF_8);
- }
- catch (java.io.UnsupportedEncodingException e)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.couldntEncode") + SP + //$NON-NLS-1$
- "'" + elem + "'" + "!" + SP + JS + SP + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- return elem;
- }
-
- private HttpsURLConnection getConn(String url, String method, boolean in, boolean out, String cookie)
- {
- URL u = null;
- try
- {
- u = new URL(url);
- }
- catch (java.net.MalformedURLException e)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.badURL") + CS + //$NON-NLS-1$
- url + "!" + SP + JS + SP + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- URLConnection conn = null;
- try
- {
- conn = u.openConnection();
- }
- catch (java.io.IOException e)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.failedConnection") + "!" + SP + JS + SP + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- HttpsURLConnection sconn = (HttpsURLConnection)conn;
-
- try
- {
- sconn.setRequestMethod(method);
- }
- catch (java.net.ProtocolException e)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.badHTTPMethod") + "!" + SP + JS + SP + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (method.equals(POST))
- {
- sconn.setRequestProperty(CONTENT_TYPE, APPLICATION_X_WWW_FORM_URLENCODED);
- }
-
- if (!cookie.equals(EMPTY))
- {
- sconn.setRequestProperty(COOKIE, cookie);
- }
-
- sconn.setDoInput(in);
- sconn.setDoOutput(out);
-
- try
- {
- sconn.connect();
- }
- catch (java.io.IOException e)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.connectError") + SP + //$NON-NLS-1$
- url + "!" + SP + JS + SP + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- return sconn;
- }
-
- private void sendStream(HttpsURLConnection conn, String req)
- {
- try
- {
- PrintWriter out = new PrintWriter(conn.getOutputStream());
- out.print(req);
- out.flush();
- out.close();
- }
- catch (java.io.IOException e)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.streamWriteError") + "!" + SP + JS + SP + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- private String slurpStream(HttpsURLConnection conn)
- {
- String ret = EMPTY;
- try
- {
- BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- String tmp;
- while ((tmp = in.readLine()) != EMPTY && tmp != null)
- {
- ret += tmp + NL;
- }
-
- in.close();
- }
- catch (java.io.IOException e)
- {
- throw new BuildException(Messages.getString("UpdateBugStateTask.streamReadError") + "!" + SP + JS + SP + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return ret;
- }
-
- /* this will only keep the last comment, but we don't use the comments anyways */
- private Hashtable parseXML(String xml)
- {
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.parsingXML") + "..."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- Hashtable pxml = new Hashtable();
- Pattern p = Pattern.compile(XML_REGEX);
- Matcher m = p.matcher(xml);
- while (m.find())
- {
- if (debug > 1)
- {
- System.err.println(Messages.getString("UpdateBugStateTask.found") + SP + m.group(1) + SP + EQ + SP + m.group(2)); //$NON-NLS-1$
- }
- pxml.put(m.group(1), m.group(2));
- }
-
- return pxml;
- }
-
- private String htmlDecode(String str)
- {
- for (Iterator i = trans.keySet().iterator(); i.hasNext();)
- {
- String elem = i.next().toString();
-
- str = Pattern.compile(elem).matcher(str).replaceAll(trans.get(elem).toString());
- }
-
- return str;
- }
-
- public static void main(String args[])
- {
- new UpdateBugStateTask();
- }
-}
diff --git a/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/util/bugzilla/Messages.java b/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/util/bugzilla/Messages.java
deleted file mode 100644
index d36f0f1..0000000
--- a/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/util/bugzilla/Messages.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-package org.eclipse.releng.util.bugzilla;
-
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-
-public class Messages
-{
- private static final String BUNDLE_NAME = "org.eclipse.releng.util.bugzilla.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages()
- {
- }
-
- public static String getString(String key)
- {
- try
- {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e)
- {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/util/bugzilla/messages.properties b/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/util/bugzilla/messages.properties
deleted file mode 100644
index 415e9c1..0000000
--- a/bundles/org.eclipse.build.tools/src_bugzilla/org/eclipse/releng/util/bugzilla/messages.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-UpdateBugStateTask.invalidStatus=Invalid initial status
-UpdateBugStateTask.expectedOne=Expected one of
-UpdateBugStateTask.invalidResolution=Invalid resolution
-UpdateBugStateTask.expected=Expected
-UpdateBugStateTask.default=default
-UpdateBugStateTask.invalidBuildID=Invalid buildID. Entered
-UpdateBugStateTask.invalidTimestamp=Invalid timestamp (must be yyyymmddHHMM or yyyymmdd0000). Entered
-UpdateBugStateTask.expectingLogin=Was expecting a login
-UpdateBugStateTask.expectingLogincookie=Was expecting a logincookie
-UpdateBugStateTask.legitimateLoginAndPassword=I need a legitimate login and password to continue.
-UpdateBugStateTask.expectingStatus=Was expecting an initial status
-UpdateBugStateTask.usingBugList=Using explicit bug list
-UpdateBugStateTask.found=Found
-UpdateBugStateTask.expectingProduct=Was expecting a product
-UpdateBugStateTask.queryingFor=Querying for
-UpdateBugStateTask.bugs=bugs
-UpdateBugStateTask.connectingTo=Connecting to
-UpdateBugStateTask.gotBugList=Got bug list
-UpdateBugStateTask.ambiguousRequest=Ambiguous request
-UpdateBugStateTask.mutuallyExclusive=bugList and (endDate, milestone, product) are mutually exclusive
-UpdateBugStateTask.invalidBugID=Invalid bugID
-UpdateBugStateTask.latestBuild=latest build
-UpdateBugStateTask.fixedIn=Fixed in
-UpdateBugStateTask.usingCookie=Using cookie information
-UpdateBugStateTask.usingComment=Using comment
-UpdateBugStateTask.gotXML=Got xml
-UpdateBugStateTask.noBugStatus=Couldn't find bug_status for bug
-UpdateBugStateTask.missingBug=this means that the bug probably doesn't exist, ignoring.
-UpdateBugStateTask.postingData=Posting data
-UpdateBugStateTask.gotResponse=Got response
-UpdateBugStateTask.setBug=Set bug
-UpdateBugStateTask.setBugFailed=Failed to set bug
-UpdateBugStateTask.to=to
-UpdateBugStateTask.was=was
-UpdateBugStateTask.ignoreBug=Ignoring bug
-UpdateBugStateTask.notInExpectedState=as not in expected state
-UpdateBugStateTask.couldntEncode=Couldn't encode
-UpdateBugStateTask.couldNotLogIn=Could not use your login/logincookie credentials to log in.
-UpdateBugStateTask.badURL=Bad URL
-UpdateBugStateTask.failedConnection=Couldn't open connection
-UpdateBugStateTask.badHTTPMethod=Bad HTTP method
-UpdateBugStateTask.connectError=Error connecting to
-UpdateBugStateTask.streamWriteError=Error writing to stream
-UpdateBugStateTask.streamReadError=Error in reading from stream
-UpdateBugStateTask.BugzillaReplied=Bugzilla replied
-UpdateBugStateTask.parsingXML=Parsing xml
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedAddEntryTask.java b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedAddEntryTask.java
deleted file mode 100644
index d0a6d96..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedAddEntryTask.java
+++ /dev/null
@@ -1,584 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.releng.generators.rss;
-
-//TODO: bug - can't run CreateFeed and AddEntry together when debug=2 - file locking problem?
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.util.Date;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.util.DateUtils;
-
-import org.eclipse.releng.util.rss.Messages;
-import org.eclipse.releng.util.rss.RSSFeedUtil;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-/**
- * Parameters:
- * debug - more output to console - eg., 0|1|2
- *
- * file - path to the XML file that will be created - eg., /path/to/file.to.create.xml
- * project - project's name, used to label the feed - eg., Eclipse, EMF, UML2
- * branch - build's branch, eg., 2.2.0
- * buildID - build's ID, eg., S200605051234
- * feedURL - URL of the feed where it will be published - eg., http://servername/path/to/feed.xml
- * note that feedURL is not required if the feed already exists, only if a new feed file must be created
- * buildURL - URL of the build being added to the feed - eg., http://servername/path/to/project/branch/buildID/
- *
- * buildAlias - build's alias, eg., 2.2.0RC2
- *
- * dependencyURLs - upstream dependencies, eg., UML2 depends on emf and eclipse, so specify TWO URLs in properties file or ant task
- *
- * releaseNotesURL - URL of the build's release notes page - eg., http://www.eclipse.org/project/news/release-notes.php
- * updateManagerURL - URL of the build's Update Manager site - eg., http://servername/path/to/project/updates/
- * downloadsURL - URL of the build's downloads - eg., http://servername/path/to/project/downloads/
- *
- * jarSigningStatus - code to define jar signing status - eg., one of:
- * NONE (or '') - no status available or not participating
- * UNSIGNED - no jar signage available or done yet
- * SIGNREADY - jars promoted to eclipse.org, ready for signing
- * BUILDREADY - signed on eclipse.org, ready to be collected and bundled as zips and copied to UM site
- * SIGNED - signed & bundled on download page and on UM site
- *
- * callistoStatus - code to define Callisto status, eg., one of:
- * NONE (or '') - not part of Callisto or unknown status
- * BUILDCOMPLETE - Have you finished your RC1 bits?
- * 2006-05-02T20:50:00Z - When do you expect to finish them?
- * TPTP - If you're waiting for another project, which one(s)? (TPTP is just an example)
- * UMSITEREADY - Have you placed those bits in your update site?
- * CALLISTOSITEREADY - Have you updated the features.xml file in the Callisto CVS directory?
- * COMPLETE - Are you ready for RC1 to be declared?
- *
- * buildType - code to define type of build, eg., one of:
- * N - Nightly
- * I - Integration
- * M - Maintenance
- * S - Stable (Milestone or Release Candidate)
- * R - Release
- * MC - Maintenance-Callisto
- * SC - Stable-Callisto
- * RC - Release-Callisto
- *
- * Releases - comma or space-separated list of releases in quints of os,ws,arch,type/name,filename,...
- * - eg., win32,win,x86,SDK,eclipse-SDK-3.2RC5-win32.zip,linux,gtk,x86_64,SDK,eclipse-SDK-3.2RC5-linux-gtk.tar.gz
- * - (for examples and definitions of ws, os + arch, see below)
- *
- * JUnitTestURL - URL of the build's JUnit test results - eg., http://servername/path/to/project/branch/buildID/testResults.php
- * performanceTestURL - URL of the build's performance tests - eg., http://servername/path/to/project/branch/buildID/performance/performance.php
- * APITestURL - URL of the build's API test results - eg., http://servername/path/to/project/branch/buildID/testResults.php
- *
- * JUnitTestResults - comma or space-separated list of test results in quads of os,ws,arch,status,os,ws,status,arch,... - eg., win32,win,x86,PASS,linux,gtk,x86,PASS
- * performanceTestResults - comma or space-separated list of test results in quads of os,ws,arch,status,os,ws,status,arch,... - eg., win32,win,x86_64,PASS,linux,gtk,x86_64,PASS
- * APITestResults - comma or space-separated list of test results in quads of os,ws,arch,status,os,ws,status,arch,... - eg., win32,win,ppc,PASS,linux,gtk,ppc,PASS
- * ws - window system - eg., ALL, win32, win64, linux, macos...
- * os - operating system - eg., ALL, win, gtk, motif, carbon, ...
- * arch - architecture, eg., ALL, x86, x86_64, ppc, ...
- * status - status code for test results - eg., one of: PASS, PENDING, FAIL, UNKNOWN, SKIPPED
- *
- * @author nickb
- *
- */
-public class RSSFeedAddEntryTask extends Task {
-
- private int debug = 0;
-
- private static final String now = getTimestamp();
-
- //$ANALYSIS-IGNORE codereview.java.rules.portability.RulePortabilityLineSeparators
- private static final String NL="\n"; //$NON-NLS-1$
- private static final String NS = ""; //$NON-NLS-1$
- private static final String SEP = "----"; //$NON-NLS-1$
- private static final String SP = " "; //$NON-NLS-1$
-
- private static final String splitter = "[,\t " + NL + "]+"; //$NON-NLS-1$ //$NON-NLS-2$
-
- //required fields
- private File file;
- private String project;
- private String branch;
- private String buildID;
- private String feedURL;
- private String buildURL;
-
- //optional
- private String buildAlias;
-
- //optional
- private String[] dependencyURLs = new String[] {};
-
- //optional
- private String releaseNotesURL;
- private String updateManagerURL;
- private String downloadsURL;
- private String jarSigningStatus;
- private String callistoStatus;
- private String buildType;
-
- //optional
- private String[] releases = new String[] {};
-
- //optional
- private String JUnitTestURL;
- private String performanceTestURL;
- private String APITestURL;
- private String[] JUnitTestResults;
- private String[] performanceTestResults;
- private String[] APITestResults;
-
- //optional
- public void setDebug(int debug) { this.debug = debug; }
-
- //required fields
- public void setFile(String file) {
- if (isNullString(file))
- { System.err.println(Messages.getString("RSSFeedCommon.FileError")); } //$NON-NLS-1$
- else
- { this.file = new File(file); }
- }
- public void setProject(String project) {
- if (isNullString(project))
- { System.err.println(Messages.getString("RSSFeedCommon.ProjectError")); } //$NON-NLS-1$
- else
- { this.project = project; }
- }
- public void setBranch(String branch) {
- if (isNullString(branch))
- { System.err.println(Messages.getString("RSSFeedAddEntryTask.BranchError")); } //$NON-NLS-1$
- else
- { this.branch = branch; }
- }
- public void setBuildID(String buildID) {
- if (isNullString(buildID))
- { System.err.println(Messages.getString("RSSFeedAddEntryTask.BuildIDError")); } //$NON-NLS-1$
- else
- { this.buildID = buildID; }
- }
- public void setFeedURL(String feedURL) {
- if (isNullString(feedURL))
- { System.err.println(Messages.getString("RSSFeedCommon.FeedURLError")); } //$NON-NLS-1$
- else
- { this.feedURL = feedURL; }
- }
- public void setBuildURL(String buildURL) {
- if (isNullString(buildURL))
- { System.err.println(Messages.getString("RSSFeedAddEntryTask.BuildURLError")); } //$NON-NLS-1$
- else
- { this.buildURL = buildURL; }
- }
-
- //optional: alias is usually something like "3.2.0M6"
- public void setBuildAlias(String buildAlias) { this.buildAlias = buildAlias; }
-
- //optional: upstream dependencies, eg., UML2 depends on emf and eclipse, so specify TWO URLs in properties file or ant task
- public void setDependencyURLs(String dependencyURLs) { if (!isNullString(dependencyURLs)) { this.dependencyURLs = dependencyURLs.split(splitter); } }
-
- //optional: define releases available in this build for a series of operating systems, windowing systems, and type
- public void setReleases(String releases) { if (!isNullString(releases)) { this.releases = releases.split(splitter); } }
-
- //optional: informational links to release notes, downloads, update manager
- public void setReleaseNotesURL(String releaseNotesURL) { this.releaseNotesURL = releaseNotesURL; }
- public void setUpdateManagerURL(String updateManagerURL) { this.updateManagerURL = updateManagerURL; }
- public void setDownloadsURL(String downloadsURL) { this.downloadsURL = downloadsURL; }
- public void setJarSigningStatus(String jarSigningStatus) { this.jarSigningStatus = jarSigningStatus; }
- public void setCallistoStatus(String callistoStatus) { this.callistoStatus = callistoStatus; }
- public void setBuildType(String buildType) {
- if (!isNullString(buildType))
- {
- this.buildType = buildType;
- }
- else
- {
- this.buildType = buildID.replaceAll("[^NIMSR]", NS); //$NON-NLS-1$
- if (this.buildType.length()>1)
- {
- this.buildType=this.buildType.substring(0, 1);
- }
- }
-
- }
-
- //optional: test URLs and results
- public void setJUnitTestURL(String JUnitTestURL) { this.JUnitTestURL = JUnitTestURL; }
- public void setPerformanceTestURL(String performanceTestURL) { this.performanceTestURL = performanceTestURL; }
- public void setAPITestURL(String APITestURL) { this.APITestURL = APITestURL; }
- public void setJUnitTestResults(String JUnitTestResults) { if (!isNullString(JUnitTestResults)) { this.JUnitTestResults = JUnitTestResults.split(splitter); } }
- public void setPerformanceTestResults(String performanceTestResults) { if (!isNullString(performanceTestResults)) { this.performanceTestResults = performanceTestResults.split(splitter); } }
- public void setAPITestResults(String APITestResults) { if (!isNullString(APITestResults)) { this.APITestResults = APITestResults.split(splitter); } }
-
- // The method executing the task
- public void execute() throws BuildException {
- if (debug>0) {
- System.out.println(Messages.getString("RSSFeedAddEntryTask.AddingEntryTo") + project + SP + Messages.getString("RSSFeedCommon.RSSFeedFile") + SP + file.toString() + ", " + Messages.getString("RSSFeedCommon.ToBePublishedAt") + feedURL); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
- updateFeedXML(file); // load previous
- }
-
- //$ANALYSIS-IGNORE codereview.java.rules.exceptions.RuleExceptionsSpecificExceptions
- private void updateFeedXML(File file){
- if (!file.exists()) {
- System.out.println(Messages.getString("RSSFeedCommon.RSSFeedFile") + SP + file.toString() + SP + Messages.getString("RSSFeedAddEntryTask.DoesNotExist")); //$NON-NLS-1$ //$NON-NLS-2$
- RSSFeedCreateFeedTask creator=new RSSFeedCreateFeedTask();
- creator.setFile(file.toString());
- creator.setFeedURL(feedURL);
- creator.setProject(project);
- creator.setDebug(debug);
- creator.execute();
- }
- DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- DocumentBuilder documentBuilder=null;
- try {
- documentBuilder=documentBuilderFactory.newDocumentBuilder();
- }
- catch (ParserConfigurationException e) {
- e.printStackTrace();
- }
- Document document=null;
- try {
- document=documentBuilder.parse(file);
- }
- catch (SAXException e) {
- e.printStackTrace();
- }
- catch (IOException e) {
- e.printStackTrace();
- }
-
- Transformer transformer = null;
- try {
- transformer = createTransformer("UTF-8"); //$NON-NLS-1$
- } catch (TransformerException e) {
- e.printStackTrace();
- }
-
- Element element=document.getDocumentElement();
- for (Node child=element.getFirstChild(); child != null; child=child.getNextSibling()) {
- if ("updated".equals(child.getLocalName())) { //$NON-NLS-1$
- if (debug > 0) {
- System.out.println(Messages.getString("RSSFeedCommon.Set") + " <" + child.getLocalName()+ ">"+ now+ "</"+ child.getLocalName()+ ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- ((Element)child).setTextContent(now);
- }
- else if ("id".equals(child.getLocalName())) { //$NON-NLS-1$
- Node newNode=createEntry(document);
- if (debug > 0) {
- System.out.println(Messages.getString("RSSFeedAddEntryTask.AttachNew") + " <entry/>"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- try {
- if (debug > 0) {
- System.out.println(SEP); //$NON-NLS-1$
- transformer.transform(new DOMSource(newNode),new StreamResult(System.out));
- System.out.println(SEP); //$NON-NLS-1$
- }
- }
- catch (TransformerException e) {
- e.printStackTrace();
- }
- Node refNode=child.getNextSibling();
- element.insertBefore(document.createTextNode(NL + " "),refNode); //$NON-NLS-1$
- element.insertBefore(newNode,refNode);
- break;
- }
- }
- try {
- transformer.transform(new DOMSource(document),new StreamResult(new OutputStreamWriter(new FileOutputStream(file))));
- if (debug > 1) {
- System.out.println(SEP); //$NON-NLS-1$
- transformer.transform(new DOMSource(document),new StreamResult(System.out));
- System.out.println(SEP); //$NON-NLS-1$
- }
- }
- catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- catch (TransformerException e) {
- e.printStackTrace();
- }
- }
-
-
- private Element createEntry(Document document) {
-
-// <entry>
- Element entry = document.createElement("entry"); //$NON-NLS-1$
-
- String[] txt = { NL + " ", NL + " ", NL + " ", NL + " ", NL + " " , NL + " " }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- Element elem = null;
-
- String projectVersionString = project + SP + (!isNullString(buildAlias)? //$NON-NLS-1$
- (buildAlias.startsWith(branch) ?
- buildAlias + " (" + buildID + ")" : // 2.2.0RC2 (S200605051234) //$NON-NLS-1$ //$NON-NLS-2$
- buildAlias + " (" + branch + "." + buildID + ")") : // Foobar (2.2.0.S200605051234) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- branch + SP + buildID); // 2.2.0.S200605051234 //$NON-NLS-1$
-
- doVarSubs();
-
-// <title>[announce] " + project + SP + branch + SP + buildID + " is available</title>
- elem = document.createElement("title"); //$NON-NLS-1$
- elem.setTextContent(Messages.getString("RSSFeedAddEntryTask.AnnouncePrefix") + projectVersionString + SP + Messages.getString("RSSFeedAddEntryTask.IsAvailable")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- attachNode(document, entry, elem, txt[1]);
-
-// <link href=\"" + buildURL + "\"/>
- elem = document.createElement("link"); //$NON-NLS-1$
- elem.setAttribute("href", !isNullString(buildURL) ? buildURL : projectVersionString); //$NON-NLS-1$
- attachNode(document, entry, elem, txt[1]);
-
-// <id>" + buildURL + "</id>
- elem = document.createElement("id"); //$NON-NLS-1$
- elem.setTextContent(!isNullString(buildURL) ? buildURL : projectVersionString);
- attachNode(document, entry, elem, txt[1]);
-
-// <updated>" + getTimestamp() + "</updated>
- elem = document.createElement("updated"); //$NON-NLS-1$
- elem.setTextContent(now);
- attachNode(document, entry, elem, txt[1]);
-
-// <summary>
- Element summary = document.createElement("summary"); //$NON-NLS-1$
- attachNode(document, entry, summary, txt[1]);
-
-// <build callisto="" jars="" type="" href="" xmlns="http://www.eclipse.org/2006/BuildFeed">
- Element build = document.createElement("build"); //$NON-NLS-1$
- build.setAttribute("jars", jarSigningStatus); //$NON-NLS-1$
- build.setAttribute("callisto", callistoStatus); //$NON-NLS-1$
- build.setAttribute("type", buildType); //$NON-NLS-1$
- build.setAttribute("xmlns", "http://www.eclipse.org/2006/BuildFeed"); //$NON-NLS-1$ //$NON-NLS-2$
- if (!isNullString(buildURL)) {
- build.setAttribute("href",buildURL); //$NON-NLS-1$
- }
- attachNode(document, summary, build, txt[2]);
-
-// <update>" + usiteURL + "</update>
- if (!isNullString(updateManagerURL)) {
- elem = document.createElement("update"); //$NON-NLS-1$
- elem.setTextContent(updateManagerURL);
- attachNode(document, build, elem, txt[3]);
- }
-
-// <downloads>" + dropsURL + "</downloads>
- if (!isNullString(downloadsURL)) {
- elem = document.createElement("downloads"); //$NON-NLS-1$
- elem.setTextContent(downloadsURL);
- attachNode(document, build, elem, txt[3]);
- }
-
-// <releasenotes>" + releaseNotesURL + "</releasenotes>
- if (!isNullString(releaseNotesURL)) {
- elem = document.createElement("releasenotes"); //$NON-NLS-1$
- elem.setTextContent(releaseNotesURL);
- attachNode(document, build, elem, txt[3]);
- }
-
-// <releases>
-// <release os="" ws="" type=""> + filename + </release>
- if (releases!=null && releases.length>0) {
- if (releases.length % 5 != 0) {
- System.err.println(Messages.getString("RSSFeedAddEntryTask.WrongNumberOfVariables") + SP + Messages.getString("RSSFeedAddEntryTask.MustBeMultipleOf5") + SP + Messages.getString("RSSFeedAddEntryTask.InProperty") + SP + "releases"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- Element releasesElem = document.createElement("releases"); //$NON-NLS-1$
- for (int i = 0; i < releases.length; i+=5)
- {
- Element release = document.createElement("release"); //$NON-NLS-1$
- release.setAttribute("os", releases[i]); //$NON-NLS-1$
- release.setAttribute("ws", releases[i+1]); //$NON-NLS-1$
- release.setAttribute("arch", releases[i+2]); //$NON-NLS-1$
- release.setAttribute("type", releases[i+3]); //$NON-NLS-1$
- release.setTextContent(varSub(releases[i+4]));
- attachNode(document, releasesElem, release, txt[4]);
- }
- attachNode(document, build, releasesElem, txt[3]);
- }
-
-// <tests>
- Element tests = document.createElement("tests"); //$NON-NLS-1$
-
-// <test type=\"junit\" href=\"" + JUnitTestURL + "\"/>
- if (!isNullString(JUnitTestURL)) {
- Element test = document.createElement("test"); //$NON-NLS-1$
- test.setAttribute("type", "junit"); //$NON-NLS-1$ //$NON-NLS-2$
- test.setAttribute("href", JUnitTestURL); //$NON-NLS-1$
- if (JUnitTestResults!=null && JUnitTestResults.length>0) {
- if (JUnitTestResults.length % 4 != 0) {
- System.err.println(Messages.getString("RSSFeedAddEntryTask.WrongNumberOfVariables") + SP + Messages.getString("RSSFeedAddEntryTask.MustBeMultipleOf4") + SP + Messages.getString("RSSFeedAddEntryTask.InProperty") + SP + "JUnitTestResults"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- for (int i = 0; i < JUnitTestResults.length; i+=4)
- {
- Element result = document.createElement("result"); //$NON-NLS-1$
- result.setAttribute("os", JUnitTestResults[i]); //$NON-NLS-1$
- result.setAttribute("ws", JUnitTestResults[i+1]); //$NON-NLS-1$
- result.setAttribute("arch", JUnitTestResults[i+2]); //$NON-NLS-1$
- result.setTextContent(JUnitTestResults[i+3]);
- attachNode(document, test, result, txt[5]);
- }
- // extra space to close containing tag
- elem.appendChild(document.createTextNode(txt[4]));
- }
- attachNode(document, tests, test, txt[4]);
- }
-
-// <test type=\"performance\" href=\"" + performanceTestURL + "\"/>
- if (!isNullString(performanceTestURL)) {
- Element test = document.createElement("test"); //$NON-NLS-1$
- test.setAttribute("type", "performance"); //$NON-NLS-1$ //$NON-NLS-2$
- test.setAttribute("href", performanceTestURL); //$NON-NLS-1$
- if (performanceTestResults!=null && performanceTestResults.length>0) {
- if (performanceTestResults.length % 4 != 0) {
- System.err.println(Messages.getString("RSSFeedAddEntryTask.WrongNumberOfVariables") + SP + Messages.getString("RSSFeedAddEntryTask.MustBeMultipleOf4") + SP + Messages.getString("RSSFeedAddEntryTask.InProperty") + SP + "performanceTestResults"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- for (int i = 0; i < performanceTestResults.length; i+=4)
- {
- Element result = document.createElement("result"); //$NON-NLS-1$
- result.setAttribute("os", performanceTestResults[i]); //$NON-NLS-1$
- result.setAttribute("ws", performanceTestResults[i+1]); //$NON-NLS-1$
- result.setAttribute("arch", performanceTestResults[i+2]); //$NON-NLS-1$
- result.setTextContent(performanceTestResults[i+3]);
- attachNode(document, test, result, txt[5]);
- }
- // extra space to close containing tag
- test.appendChild(document.createTextNode(txt[4]));
- }
- attachNode(document, tests, test, txt[4]);
- }
-
-// <test type=\"performance\" href=\"" + performanceTestURL + "\"/>
- if (!isNullString(APITestURL)) {
- Element test = document.createElement("test"); //$NON-NLS-1$
- test.setAttribute("type", "api"); //$NON-NLS-1$ //$NON-NLS-2$
- test.setAttribute("href", APITestURL); //$NON-NLS-1$
- if (APITestResults!=null && APITestResults.length>0) {
- if (APITestResults.length % 4 != 0) {
- System.err.println(Messages.getString("RSSFeedAddEntryTask.WrongNumberOfVariables") + SP + Messages.getString("RSSFeedAddEntryTask.MustBeMultipleOf4") + SP + Messages.getString("RSSFeedAddEntryTask.InProperty") + SP + "APITestResults"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- for (int i = 0; i < APITestResults.length; i+=4)
- {
- Element result = document.createElement("result"); //$NON-NLS-1$
- result.setAttribute("os", APITestResults[i]); //$NON-NLS-1$
- result.setAttribute("ws", APITestResults[i+1]); //$NON-NLS-1$
- result.setAttribute("arch", APITestResults[i+2]); //$NON-NLS-1$
- result.setTextContent(APITestResults[i+3]);
- attachNode(document, tests, result, txt[5]);
- }
- // extra space to close containing tag
- test.appendChild(document.createTextNode(txt[4]));
- }
- attachNode(document, tests, test, txt[4]);
- }
-
- attachNode(document, build, tests, txt[3]);
-
- if (dependencyURLs!=null && dependencyURLs.length>0) {
- // <dependencies>
- // <dependency>" + dependencyURL + "</dependency>
- Element dependencies = document.createElement("dependencies"); //$NON-NLS-1$
- for (int i = 0; i < dependencyURLs.length; i++)
- {
- elem = document.createElement("dependency"); //$NON-NLS-1$
- elem.setTextContent(dependencyURLs[i]);
- attachNode(document, dependencies, elem, txt[4]);
- }
- attachNode(document, build, dependencies, txt[3]);
- }
-
- return entry;
- }
-
- //$ANALYSIS-IGNORE codereview.java.rules.exceptions.RuleExceptionsSpecificExceptions
- private void attachNode(Document document,Element entry,Element elem,String txt){
- entry.appendChild(document.createTextNode(txt));
- entry.appendChild(elem);
- }
-
- private static String getTimestamp() { // eg., 2006-04-10T20:40:08Z
- return DateUtils.format(new Date(), DateUtils.ISO8601_DATETIME_PATTERN) + "Z"; //$NON-NLS-1$
- }
-
- private void doVarSubs()
- {
- feedURL = varSub(feedURL);
- buildURL = varSub(buildURL);
-
- releaseNotesURL = varSub(releaseNotesURL);
- updateManagerURL = varSub(updateManagerURL);
- downloadsURL = varSub(downloadsURL);
-
- JUnitTestURL = varSub(JUnitTestURL);
- performanceTestURL = varSub(performanceTestURL);
- APITestURL = varSub(APITestURL);
- }
-
- public static Transformer createTransformer(String encoding) throws TransformerException
- {
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
-
- try
- {
- transformerFactory.setAttribute("indent-number", new Integer(2)); //$NON-NLS-1$
- }
- catch (IllegalArgumentException exception)
- {
- }
-
- Transformer transformer = transformerFactory.newTransformer();
-
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
-
- // Unless a width is set, there will be only line breaks but no indentation.
- // The IBM JDK and the Sun JDK don't agree on the property name,
- // so we set them both.
- //
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
- transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
- if (encoding != null)
- {
- transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
- }
- return transformer;
- }
-
- /*
- * variable substitution in URLs - eg., replace %%branch%% and %%buildID%% in buildURL
- */
- private String varSub(String urlstring)
- {
- if (!isNullString(urlstring) && urlstring.indexOf("%%")>=0) //$NON-NLS-1$
- {
- return urlstring.replaceAll(Messages.getString("RSSFeedAddEntryTask.BranchKeyword"), branch).replaceAll(Messages.getString("RSSFeedAddEntryTask.BuildIDKeyword"), buildID).replaceAll(Messages.getString("RSSFeedAddEntryTask.BuildAliasKeyword"), buildAlias); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return urlstring;
- }
-
- private static boolean isNullString(String str)
- {
- return RSSFeedUtil.isNullString(str);
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedCreateFeedTask.java b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedCreateFeedTask.java
deleted file mode 100644
index 042c0cf..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedCreateFeedTask.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.releng.generators.rss;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.util.Date;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.util.DateUtils;
-
-import org.eclipse.releng.util.rss.Messages;
-import org.eclipse.releng.util.rss.RSSFeedUtil;
-
-//TODO: bug - can't run CreateFeed and AddEntry back when debug=2
-
-/**
- * Parameters:
- * debug - more output to console - eg., 0|1|2
- *
- * file - path to the XML file that will be created - eg., /path/to/file.to.create.xml
- * project - project's name, used to label the feed - eg., Eclipse, EMF, UML2
- * feedURL - URL of the feed where it will be published - eg., http://servername/path/to/feed.xml
- * @author nickb
- *
- */
-public class RSSFeedCreateFeedTask extends Task {
-
- private int debug = 0;
-
- //$ANALYSIS-IGNORE codereview.java.rules.portability.RulePortabilityLineSeparators
- private static final String NL="\n"; //$NON-NLS-1$
- private static final String NS = ""; //$NON-NLS-1$
- private static final String SP = " "; //$NON-NLS-1$
-
- //required fields
- private File file;
- private String project;
- private String feedURL;
-
- //optional
- public void setDebug(int debug) { this.debug = debug; }
-
- //required fields
- public void setFile(String file) {
- if (isNullString(file))
- { System.err.println(Messages.getString("RSSFeedCommon.FileError")); } //$NON-NLS-1$
- else
- { this.file = new File(file); }
- }
- public void setProject(String project) {
- if (isNullString(project))
- { System.err.println(Messages.getString("RSSFeedCommon.ProjectError")); } //$NON-NLS-1$
- else
- { this.project = project; }
- }
- public void setFeedURL(String feedURL) {
- if (isNullString(feedURL))
- { System.err.println(Messages.getString("RSSFeedCommon.FeedURLError")); } //$NON-NLS-1$
- else
- { this.feedURL = feedURL; }
- }
-
- // The method executing the task
- public void execute() throws BuildException {
- if (debug>0) {
- System.out.println(Messages.getString("RSSFeedCreateFeedTask.Creating") + project + SP + Messages.getString("RSSFeedCommon.RSSFeedFile") + SP + file.toString() + ", " + Messages.getString("RSSFeedCommon.ToBePublishedAt") + feedURL); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
- writeFeedXML(createFeedXML(),file);
- if (debug>1) {
- writeFeedXML(createFeedXML(),System.out);
- }
- }
-
- private String createFeedXML() {
- StringBuffer sb = new StringBuffer();
- sb.append("<?xml-stylesheet href=\"http://www.blogger.com/styles/atom.css\" type=\"text/css\"?>" + NL); //$NON-NLS-1$
- sb.append("<feed xmlns=\"http://www.w3.org/2005/Atom\">" + NL); //$NON-NLS-1$
- sb.append(" <title>" + project + SP + Messages.getString("RSSFeedCreateFeedTask.Builds") + "</title>" + NL); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- sb.append(" <link rel=\"self\" type=\"application/atom+xml\" href=\"" + (!isNullString(feedURL)?feedURL:NS) + "\"/>" + NL); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- sb.append(" <updated>" + getTimestamp() + "</updated>" + NL); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append(" <author>" + NL); //$NON-NLS-1$
- sb.append(" <name>" + (!isNullString(project)?project + SP : NS) + Messages.getString("RSSFeedCreateFeedTask.BuildTeam") + "</name>" + NL); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- sb.append(" </author>" + NL); //$NON-NLS-1$
- sb.append(" <id>" + (!isNullString(feedURL)?feedURL:NS) + "</id>" + NL); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- sb.append("</feed>" + NL + NL); //$NON-NLS-1$
- return sb.toString();
- }
-
- private void writeFeedXML(String feedXML,File file) {
- try{
- PrintWriter writer = new PrintWriter(new FileWriter(file));
- writer.println(feedXML);
- writer.flush();
- writer.close();
- } catch (IOException e){
- System.out.println(Messages.getString("RSSFeedCreateFeedTask.UnableToWriteToFile")+file); //$NON-NLS-1$
- }
-
- }
-
- private void writeFeedXML(String feedXML, PrintStream ps) {
- PrintWriter writer = new PrintWriter(ps);
- writer.println(feedXML);
- writer.flush();
- writer.close();
- }
-
- private String getTimestamp() { // eg., 2006-04-10T20:40:08Z
- return DateUtils.format(new Date(), DateUtils.ISO8601_DATETIME_PATTERN) + "Z"; //$NON-NLS-1$
- }
-
- private static boolean isNullString(String str)
- {
- return RSSFeedUtil.isNullString(str);
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedGetPropertyTask.java b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedGetPropertyTask.java
deleted file mode 100644
index b8f4855..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedGetPropertyTask.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.releng.generators.rss;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-import org.eclipse.releng.util.rss.Messages;
-import org.eclipse.releng.util.rss.RSSFeedUtil;
-
-/**
- * Parameters:
- * debug - more output to console - eg., 0|1|2
- *
- * file - path to the XML file that will be read - eg., /path/to/file.to.read.xml
- * xpath - xpath string representing the object to read
- *
- * @author nickb
- *
- */
-public class RSSFeedGetPropertyTask extends Task {
-
- private int debug = 0;
-
- //required fields
- private File file;
-
- private String xpath;
-
- //optional
- public void setDebug(int debug) { this.debug = debug; }
-
- //required fields
- public void setFile(String file) {
- if (isNullString(file))
- { System.err.println(Messages.getString("RSSFeedCommon.FileError")); } //$NON-NLS-1$
- else
- { this.file = new File(file); }
- }
- public void setXpath(String xpath) {
- if (isNullString(xpath))
- { System.err.println(Messages.getString("RSSFeedCommon.XpathError")); } //$NON-NLS-1$
- else
- { this.xpath = xpath; }
- }
-
- // The method executing the task
- public void execute() throws BuildException {
- RSSFeedUpdateEntryTask updater = new RSSFeedUpdateEntryTask();
- updater.setFile(file.toString());
- updater.setXpath(xpath);
- updater.setDebug(debug);
- updater.execute();
- }
-
- private static boolean isNullString(String str)
- {
- return RSSFeedUtil.isNullString(str);
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedUpdateEntryTask.java b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedUpdateEntryTask.java
deleted file mode 100644
index 417b8bb..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/generators/rss/RSSFeedUpdateEntryTask.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.releng.generators.rss;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.Date;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.util.DateUtils;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.xml.sax.SAXException;
-
-import org.eclipse.releng.util.rss.Messages;
-import org.eclipse.releng.util.rss.RSSFeedUtil;
-
-/**
- * Parameters:
- * debug - more output to console - eg., 0|1|2
- *
- * file - path to the XML file that will be read - eg., /path/to/file.to.read.xml
- * xpath - xpath string representing the object to modify
- * replacement - string to use as replacement
- *
- * @author nickb
- *
- */
-public class RSSFeedUpdateEntryTask extends Task {
-
- private int debug = 0;
-
- private static final String now = getTimestamp();
-
- private static final XPath xp = XPathFactory.newInstance().newXPath();
-
- private static final String NS = ""; //$NON-NLS-1$
- private static final String SEP = "----"; //$NON-NLS-1$
- private static final String SP = " "; //$NON-NLS-1$
-
- //required fields
- private File file;
-
- private String xpath;
- private String replacement;
-
- private Transformer transformer = null;
-
- private boolean isNodeFound = false;
- private boolean isNodeChanged = false;
- private Node foundNode = null;
-
- //optional
- public void setDebug(int debug) { this.debug = debug; }
-
- //required fields
- public void setFile(String file) {
- if (isNullString(file))
- { System.err.println(Messages.getString("RSSFeedCommon.FileError")); } //$NON-NLS-1$
- else
- { this.file = new File(file); }
- }
- public void setXpath(String xpath) {
- if (isNullString(xpath))
- { System.err.println(Messages.getString("RSSFeedCommon.XpathError")); } //$NON-NLS-1$
- else
- { this.xpath = xpath; }
- }
-
- //optional - if null, display value found instead of changing it - see RSSFeedGetPropertyTask
- public void setReplacement(String replacement) { this.replacement = replacement; }
-
- // The method executing the task
- public void execute() throws BuildException {
- if (debug>0) {
- System.out.println(Messages.getString("RSSFeedUpdateEntryTask.SearchingFor") + SP + xpath + (!isNullString(replacement)?", " + Messages.getString("RSSFeedUpdateEntryTask.ReplacingWith") + " '" + replacement + "'":NS)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- }
- updateFeedXML(file); // load previous
- }
-
- //$ANALYSIS-IGNORE codereview.java.rules.exceptions.RuleExceptionsSpecificExceptions
- private void updateFeedXML(File file){
- if (file.exists()) {
- DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- DocumentBuilder documentBuilder=null;
- try {
- documentBuilder=documentBuilderFactory.newDocumentBuilder();
- }
- catch (ParserConfigurationException e) {
- e.printStackTrace();
- }
- Document document=null;
- try {
- document=documentBuilder.parse(file);
- }
- catch (SAXException e) {
- e.printStackTrace();
- }
- catch (IOException e) {
- e.printStackTrace();
- }
-
- try {
- transformer = RSSFeedAddEntryTask.createTransformer("UTF-8"); //$NON-NLS-1$
- } catch (TransformerException e) {
- e.printStackTrace();
- }
-
- if (!isNullString(replacement)) {
- setEntryNodeUpdate(document.getDocumentElement());
- }
- Node newNode=findAndReplace(document);
- if (debug > 1 && newNode != null) {
- try {
- System.out.println(SEP);
- transformer.transform(new DOMSource(newNode),new StreamResult(System.out));
- System.out.println(SEP);
- }
- catch (TransformerException e) {
- e.printStackTrace();
- }
- }
- if (!isNullString(replacement) && newNode != null) {
- try {
- transformer.transform(new DOMSource(document),new StreamResult(new PrintStream(file)));
- }
- catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- catch (TransformerException e) {
- e.printStackTrace();
- }
- }
- }
- else {
- System.out.println(Messages.getString("RSSFeedCommon.RSSFeedFile") + SP + file.toString()+ " "+ Messages.getString("RSSFeedUpdateEntryTask.DoesNotExist")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- }
-
- // get/set the desired node
- public Node getFoundNode()
- {
- return this.foundNode;
- }
- private void setFoundNode(Node foundNode)
- {
- this.foundNode = foundNode;
- }
-
- // has the desired node been found?
- public boolean getNodeFound()
- {
- return this.isNodeFound;
- }
- private void setNodeFound(boolean isNodeFound)
- {
- this.isNodeFound = isNodeFound;
- }
-
- // has the desired node been changed?
- public boolean getNodeChanged()
- {
- return this.isNodeChanged;
- }
- private void setNodeChanged(boolean isNodeChanged)
- {
- this.isNodeChanged = isNodeChanged;
- }
-
- /**
- * Modify an entry:
- *
- * <entry>
- * <title/>
- * <link href=""/>
- * <id/>
- * <updated/>
- * <summary>
- * ...
- * </summary>
- * </entry>
- */
- private Node findAndReplace(Document document) {
- Node parentEntryNode = null;
- Node aNode = null;
- if (debug==0) { System.out.print(xpath + (isNullString(replacement)?" = ":" :: ")); } //$NON-NLS-1$ //$NON-NLS-2$
- NodeList nodelist = getNodeList(document, xpath);
- // Process the elements in the nodelist
- if (nodelist != null && nodelist.getLength()>0) {
- for (int i=0; i<nodelist.getLength(); i++) {
- Node node = (Node)nodelist.item(i);
- switch (node.getNodeType())
- {
- case Node.ATTRIBUTE_NODE :
- aNode = (Attr)nodelist.item(i);
- if (debug>0) { System.out.print(Messages.getString("RSSFeedUpdateEntryTask.DebugFoundAttribute")); } //$NON-NLS-1$
- break;
-
- case Node.ELEMENT_NODE :
- aNode = (Element)nodelist.item(i);
- if (debug>0) { System.out.print(Messages.getString("RSSFeedUpdateEntryTask.DebugFoundElement")); } //$NON-NLS-1$
- break;
-
- case Node.TEXT_NODE :
- aNode = (Text)nodelist.item(i);
- if (debug>0) { System.out.print(Messages.getString("RSSFeedUpdateEntryTask.DebugFoundText")); } //$NON-NLS-1$
- break;
-
- default:
- aNode = null;
- break;
- }
- if (aNode != null) {
- setFoundNode(aNode);
- setNodeFound(true);
- System.out.print((debug>0?aNode.getNodeName() + " = ":NS) + aNode.getNodeValue()); //$NON-NLS-1$ //$NON-NLS-2$
- if (!isNullString(replacement)) { aNode.setTextContent(replacement); }
- System.out.println(isNullString(replacement)?NS:" => " + replacement); //$NON-NLS-1$ //$NON-NLS-2$
- if (debug>0) {
- try
- {
- // write to console
- System.out.println(SEP); //$NON-NLS-1$
- transformer.transform(new DOMSource(getParentNode(document,aNode,null,NS)), new StreamResult(System.out)); //$NON-NLS-1$
- System.out.println(SEP); //$NON-NLS-1$
- }
- catch (TransformerException e)
- {
- e.printStackTrace();
- }
- }
- if (!isNullString(replacement)) {
- parentEntryNode = getParentNode(document, aNode, "entry", NS); //$NON-NLS-1$ //$NON-NLS-2$
- setEntryNodeUpdate(parentEntryNode);
- }
- }
- }
- } else {
- System.out.println(Messages.getString("RSSFeedUpdateEntryTask.XpathNodeNotFound")); //$NON-NLS-1$
- }
- return parentEntryNode;
- }
-
- private Node getParentNode(Document document, Node nodeIn, String target, String indent)
- {
- Node node = nodeIn;
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- if (debug>1) { System.out.println(indent + Messages.getString("RSSFeedUpdateEntryTask.DebugGotATNode") + node.getNodeName()); } //$NON-NLS-1$
- // get the element for the attrib/text node
- NodeList nodelist = getNodeList(document, xpath.substring(0, xpath.lastIndexOf("/")));
- if (nodelist !=null && nodelist.getLength()>0)
- {
- for (int i=0; i<nodelist.getLength(); i++) {
- node = (Node)nodelist.item(i);
- break;
- }
- }
- }
- if (debug>1) { System.out.println(indent + Messages.getString("RSSFeedUpdateEntryTask.DebugGotENode") + node.getNodeName() + " (" + node.getNodeType() + ")"); } //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (!isNullString(target) && !node.getNodeName().equals(target))
- {
- node = getParentNode(document, node.getParentNode(), target, indent + "_ "); //$NON-NLS-1$
- }
- return node;
- }
-
- private NodeList getNodeList(Document document, String xpath)
- {
- NodeList nodelist = null;
- try
- {
- xp.reset();
- Object o = xp.evaluate(xpath, document, XPathConstants.NODESET);
- if (o instanceof NodeList)
- {
- nodelist = (NodeList)o;
- }
- }
- catch (XPathExpressionException e)
- {
- e.printStackTrace();
- }
- return nodelist;
- }
-
- //$ANALYSIS-IGNORE codereview.java.rules.exceptions.RuleExceptionsSpecificExceptions
- private void setEntryNodeUpdate(Node parentEntryNode){
- for (Node child=parentEntryNode.getFirstChild(); child != null; child=child.getNextSibling()) {
- if ("updated".equals(child.getLocalName())) { //$NON-NLS-1$
- if (debug > 0) {
- System.out.println(Messages.getString("RSSFeedCommon.Set") + " <" + child.getLocalName()+ ">"+ now+ "</"+ child.getLocalName()+ ">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- ((Element)child).setTextContent(now);
- setNodeChanged(true);
- break;
- }
- }
- }
-
-
- private static String getTimestamp() { // eg., 2006-04-10T20:40:08Z
- return DateUtils.format(new Date(), DateUtils.ISO8601_DATETIME_PATTERN) + "Z"; //$NON-NLS-1$
- }
-
- private static boolean isNullString(String str)
- {
- return RSSFeedUtil.isNullString(str);
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/services/rss/RSSFeedPublisherTask.java b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/services/rss/RSSFeedPublisherTask.java
deleted file mode 100644
index b26e7f9..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/services/rss/RSSFeedPublisherTask.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.releng.services.rss;
-
-//TODO: enable support for running task on Windows (problems with ssh, scp, cvs)
-//TODO: enable support for connecting to Windows server? (`mkdir -p` not supported)
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-import org.eclipse.releng.util.rss.Messages;
-import org.eclipse.releng.util.rss.RSSFeedUtil;
-
-/**
- * Parameters:
- * debug - more output to console - eg., 0|1|2
- *
- * file - path to the XML file that will be published - eg., /path/to/file.to.publish.xml
- *
- * cvsExec - path to the executable for cvs, eg., /usr/bin/cvs
- * cvsRoot - cvs root used to commit the file - eg., username@cvsserver:/cvsroot/path
- * cvsPath - cvs module to update - eg., project/news/ (into which builds.xml would go)
- * cvsTemp - path to the temp folder to use for cvs checkout
- *
- * scpExec - path to the executable for scp, eg., /usr/bin/scp
- * scpTarget - scp target path for publishing the file - eg., username@server:/path/to/target/file.xml
- *
- * Optionally, if the target folder might not exist, you can use ssh to create it before scp'ing
- * sshExec - path to the executable for ssh, eg., /usr/bin/ssh
- *
- * @author nickb
- *
- */
-public class RSSFeedPublisherTask extends Task {
-
- private int debug = 0;
-
- private static final String CL = ":"; //$NON-NLS-1$
- private static final String FS = File.separator;
- private static final String SP = " "; //$NON-NLS-1$
-
- // default values for optional fields
- private static final String DEFAULT_CVSTemp = "/tmp/tmp-RSSFeedPublisherTask"; //$NON-NLS-1$
- private static final String DEFAULT_CVSExec = "cvs"; //$NON-NLS-1$
- private static final String DEFAULT_SCPExec = "scp"; //$NON-NLS-1$
-
- private static final RSSFeedUtil util = new RSSFeedUtil();
-
- //required fields
- private File file;
-
- // required if doing CVS
- private String CVSExec;
- private String CVSRoot;
- private String CVSPath;
- private String CVSTemp;
-
- // required if doing SCP
- private String SCPExec;
- private String SCPTarget;
-
- // required if doing SCP and target dir may not already exist
- private String SSHExec;
-
- //optional
- public void setDebug(int debug) { this.debug = debug; }
-
- //required
- public void setFile(String file) {
- if (!isNullString(file)) { this.file = new File(file); }
- }
-
- //required for CVS commit (with default)
- public void setCVSExec(String CVSExec) {
- if (!isNullString(CVSExec)) {
- this.CVSExec = CVSExec;
- } else {
- this.CVSExec = DEFAULT_CVSExec;
- }
- }
-
- //required for CVS commit
- public void setCVSRoot(String CVSRoot) { this.CVSRoot = CVSRoot; }
- public void setCVSPath(String CVSPath) { this.CVSPath = CVSPath; }
-
- //required for CVS commit (with default)
- public void setCVSTemp(String CVSTemp) {
- if (!isNullString(CVSTemp)) {
- this.CVSTemp = CVSTemp;
- } else {
- this.CVSTemp = DEFAULT_CVSTemp;
- }
- }
-
- //required for CVS commit (with default)
- public void setSCPExec(String SCPExec) {
- if (!isNullString(SCPExec)) {
- this.SCPExec = SCPExec;
- } else {
- this.SCPExec = DEFAULT_SCPExec;
- }
- }
- public void setSCPTarget(String SCPTarget) { this.SCPTarget = SCPTarget; }
-
- // required if doing SCP and target dir may not already exist (with default, not assigned)
- public void setSSHExec(String SSHExec) {
- this.SSHExec = SSHExec;
- }
-
- // The method executing the task
- public void execute() throws BuildException {
-
- if (file==null || !file.exists() || !file.isFile()) {
- System.err.println(Messages.getString("RSSFeedPublisherTask.ErrorInvalidFile") + CL + SP + file + "!"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- if (debug>0) { System.out.println(Messages.getString("RSSFeedPublisherTask.Publish") + SP + file); } //$NON-NLS-1$
- if ((!isNullString(CVSRoot) && !isNullString(CVSPath)) || !isNullString(SCPTarget)) {
- if ((!isNullString(CVSRoot) && !isNullString(CVSPath))) {
- commitFeedToCVS();
- }
- if (!isNullString(SCPTarget)) {
- publishFeedWithSCP();
- }
- } else {
- System.err.println(Messages.getString("RSSFeedPublisherTask.ErrorNothingToDo")); //$NON-NLS-1$
- }
- }
- }
-
- private void commitFeedToCVS()
- {
- if (debug>1) {
- System.out.println(Messages.getString("RSSFeedPublisherTask.UsingCVSRoot") + SP + CVSRoot); //$NON-NLS-1$
- System.out.println(Messages.getString("RSSFeedPublisherTask.UsingCVSPath") + SP + CVSPath); //$NON-NLS-1$
- }
-// <!-- 3. get filename (eg., builds.xml) from file (which could include a path, eg. ./data/news/builds.xml) -->
-// <pathconvert property="filename"><path path="${file}"/><mapper type="flatten"/></pathconvert>
- String filename = file.getName();
-
-// <!-- 4. create target temp folder & check out existing version from CVS -->
-// <mkdir dir="${cvsTemp}"/>
- File CVSTempDir = new File(CVSTemp);
- if (CVSTempDir.isFile()) { // if dir exists as a file, we need a new tmp folder name
- CVSTemp += ".tmp"; //$NON-NLS-1$
- CVSTempDir = new File(CVSTemp);
- }
- if (CVSTempDir.isDirectory()) {
- if (!CVSTempDir.delete()) {
- System.err.println(Messages.getString("RSSFeedPublisherTask.ErrorCouldNotDeleteTempFolder") + SP + CVSTempDir); //$NON-NLS-1$
- }
- }
- CVSTempDir.mkdir();
- if (debug>1) {
- System.out.println(Messages.getString("RSSFeedPublisherTask.UsingCVSTemp") + SP + CVSTempDir); //$NON-NLS-1$
- }
-
-// <exec executable="${cvsExec}" dir="${cvsTemp}"><arg line="-d ${cvsRoot} co -d checkoutDir ${cvsPath}"/></exec>
- runCVSExecTask("co -d checkoutDir" + SP + CVSPath, CVSTemp); //$NON-NLS-1$
-
-// <!-- 5. check if the file already exists in CVS to see if we need to add it -->
-// <available file="${cvsTemp}/checkoutDir/${filename}" type="file" property="fileInCVS"/>
- File destFile = new File(CVSTemp + FS + "checkoutDir" + FS + filename); //$NON-NLS-1$
- boolean fileInCVS = destFile.isFile();
-
-// <!-- 6. overwrite CVS copy with new version; or if new, copy file to destination for add then check-in -->
-// <copy file="../${file}" overwrite="true" todir="${cvsTemp}/checkoutDir"/>
- try
- {
- RSSFeedUtil.transferData(new FileInputStream(file),new FileOutputStream(destFile));
- }
- catch (FileNotFoundException e)
- {
- e.printStackTrace();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
-
-// <!-- 7. add to CVS (if new) -->
-// <antcall target="addFileToCVS"/>
-// <!-- 7. Add file to CVS (if file is new) -->
-// <target name="addFileToCVS" depends="init" unless="fileInCVS" description="Add file to CVS (if file is new)">
-// <exec executable="${cvsExec}" dir="${cvsTemp}/checkoutDir"><arg line="-d ${cvsRoot} add ${filename}"/></exec>
-// </target>
- if (!fileInCVS) {
- runCVSExecTask("add " + filename, CVSTemp + FS + "checkoutDir"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// <!-- 8. check in file -->
-// <exec executable="${cvsExec}" dir="${cvsTemp}/checkoutDir"><arg line="-d ${cvsRoot} ci -m '' ${filename}"/></exec>
- runCVSExecTask("ci -m '' " + filename, CVSTemp + FS + "checkoutDir"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private void publishFeedWithSCP()
- {
- if (debug>1) {
- System.out.println(Messages.getString("RSSFeedPublisherTask.PublishToSCPTarget") + SP + SCPTarget); //$NON-NLS-1$
- }
-
-// <exec executable="${sshExec}"><arg line="${sshMakeDirCommand}"/></exec>
- if (!isNullString(SSHExec) && SCPTarget.indexOf(CL)>0) {
- String userAtHost = SCPTarget.substring(0, SCPTarget.indexOf(CL));
- String targetPath = SCPTarget.substring(SCPTarget.indexOf(CL)+1,SCPTarget.lastIndexOf(FS));
- util.runExecTask(SSHExec, userAtHost + " \"mkdir -p" + SP + targetPath + "\"", null); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// <exec executable="${scpExec}" dir="../"><arg line="${file} ${scpTarget}"/></exec>
- util.runExecTask(SCPExec, file.toString() + SP + SCPTarget, null);
- }
-
- private void runCVSExecTask(String task, String dir)
- {
- util.runExecTask(CVSExec, "-d " + CVSRoot + " -q " + task, dir); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private static boolean isNullString(String str)
- {
- return RSSFeedUtil.isNullString(str);
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/services/rss/RSSFeedWatcherTask.java b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/services/rss/RSSFeedWatcherTask.java
deleted file mode 100644
index 085d46c..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/services/rss/RSSFeedWatcherTask.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.releng.services.rss;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.ExecTask;
-
-import org.eclipse.releng.generators.rss.RSSFeedUpdateEntryTask;
-import org.eclipse.releng.util.rss.Messages;
-import org.eclipse.releng.util.rss.RSSFeedUtil;
-
-/**
- * Parameters:
- * debug - more output to console - eg., 0|1|2
- *
- * file - path to the XML file that will be published - eg., /path/to/file.to.publish.xml
- * feedURL - URL of the feed where it will be published - eg., http://servername/path/to/feed.xml
- *
- * feedWatchActions - semi-comma-separated list of triplets:
- * (Xpath to watch for); (what to execute if condition is met); (commandline args to the executable)...
- * eg., to watch for ANY change in the feed and respond by sending email
- * /*[name() = 'feed']/*[name() = 'updated']/text(); sendEmailAlert.sh; null
- * eg., to watch for ANY changes in the current build
- * //*[name() = 'entry'][1]/*[name() = 'updated']/text(); sendEmailAlert.sh; null
- * eg., to watch for changes in the current build's performance test results on linux-gtk
- * //*[name() = 'entry'][1]/*[name() = 'summary']/*[@type = 'performance'][1]/*[name() = 'results'][@os = 'linux'][@ws = 'gtk']/text(); sendEmailAlert.sh; null
- *
- * @author nickb
- *
- */
-public class RSSFeedWatcherTask extends Task {
-
- private int debug = 0;
-
- private static final String CL = ":"; //$NON-NLS-1$
- private static final String DOT = "."; //$NON-NLS-1$
- private static final String NS = ""; //$NON-NLS-1$
- private static final String SP = " "; //$NON-NLS-1$
-
- private static final String splitter = "[;\t\r\n]+"; //$NON-NLS-1$
-
- private static final String feedWatchActionError = "feedWatchAction.Error"; //$NON-NLS-1$
- private static final String feedWatchActionOuput = "feedWatchAction.Output"; //$NON-NLS-1$
- private static final String feedWatchActionResult = "feedWatchAction.Result"; //$NON-NLS-1$
- private static final String feedWatchActionNewValue = "feedWatchAction.NewValue"; //$NON-NLS-1$
- private static final String feedWatchActionOldValue = "feedWatchAction.OldValue"; //$NON-NLS-1$
- private static final String feedWatchActionTheValue = "feedWatchAction.TheValue"; //$NON-NLS-1$
-
- private static final RSSFeedUtil util = new RSSFeedUtil();
-
- //required fields
- private File file;
- private File tmpFile;
- private String feedURL;
- private String[] feedWatchActions = new String[] {};
-
- //optional
- public void setDebug(int debug) { this.debug = debug; }
-
- //required
- public void setFile(String file) {
- if (!isNullString(file)) {
- this.file = new File(file);
- this.tmpFile = new File(file + ".tmp"); //$NON-NLS-1$
- }
- }
- public void setFeedURL(String feedURL) {
- if (isNullString(feedURL))
- { System.err.println(Messages.getString("RSSFeedCommon.FeedURLError")); } //$NON-NLS-1$
- else
- { this.feedURL = feedURL; }
- }
- public void setFeedWatchActions(String feedWatchActions) {
- int missingActions = 0;
- if (!isNullString(feedWatchActions)) {
- this.feedWatchActions = feedWatchActions.split(splitter);
- missingActions = this.feedWatchActions.length % 3; if (missingActions > 0) { missingActions = 3 - missingActions; }
- }
- if (missingActions > 0) {
- for (int i = 0; i < missingActions; i++)
- {
- System.out.println((i==0 && missingActions==2 ? Messages.getString("RSSFeedWatcherTask.WarningNoScriptAction") : Messages.getString("RSSFeedWatcherTask.WarningNoCommandlineParams")) + SP + feedWatchActions ); //$NON-NLS-1$ //$NON-NLS-2$
- feedWatchActions += "; null"; //$NON-NLS-1$
- }
- this.feedWatchActions = feedWatchActions.split(splitter);
- }
- }
-
- // The method executing the task
- public void execute() throws BuildException {
- if (debug>0) { util.setDebug(debug); }
- if (file==null || !file.exists() || !file.isFile()) {
- // if there's no local copy of the feed, get a copy, then exit with instructions
- downloadFeed(file,debug>=0);
- System.out.println(Messages.getString("RSSFeedWatcherTask.PleaseRunThisTaskLater") + SP + file); //$NON-NLS-1$
- System.out.println(Messages.getString("RSSFeedWatcherTask.ToTheLatestVersion") + SP + feedURL); //$NON-NLS-1$
- } else {
- if (feedWatchActions==null || feedWatchActions.length<1) {
- System.err.println(Messages.getString("RSSFeedWatcherTask.ErrorNoWatchActions")); //$NON-NLS-1$
- } else {
- checkFeed();
- }
- }
- }
-
- private void checkFeed() {
- if (file.isDirectory()) {
- System.err.println(Messages.getString("RSSFeedWatcherTask.ErrorDestinationFileIsADirectory")); //$NON-NLS-1$
- } else {
- downloadFeed(tmpFile,debug>0);
- }
-
- if (tmpFile.isFile()) {
- if (debug>0) { System.out.println(Messages.getString("RSSFeedWatcherTask.Compare") + SP + file + Messages.getString("RSSFeedWatcherTask.with") + tmpFile + CL); } //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- RSSFeedUpdateEntryTask oldFeedWatcher = null;
- RSSFeedUpdateEntryTask newFeedWatcher = null;
- int j=0;
-
- for (int i = 0; i < feedWatchActions.length; i+=3)
- {
- String xpath = feedWatchActions[i].trim();
- String action = feedWatchActions[i+1].trim();
- String commandline = feedWatchActions[i+2].trim();
-
- oldFeedWatcher = new RSSFeedUpdateEntryTask();
- oldFeedWatcher.setFile(file.toString());
- if (debug>0) { oldFeedWatcher.setDebug(debug); }
- oldFeedWatcher.setXpath(xpath);
- oldFeedWatcher.execute();
-
- if (oldFeedWatcher.getFoundNode() != null) {
- newFeedWatcher = new RSSFeedUpdateEntryTask();
- newFeedWatcher.setFile(tmpFile.toString());
- if (debug>0) { newFeedWatcher.setDebug(debug); }
- newFeedWatcher.setXpath(xpath);
- newFeedWatcher.execute();
-
- String oldContent = oldFeedWatcher.getFoundNode().getTextContent();
- String newContent = newFeedWatcher.getFoundNode().getTextContent();
-
- if (debug>1) {
- System.out.println(Messages.getString("RSSFeedWatcherTask.GotOldNodeContents") + CL + SP + oldContent); //$NON-NLS-1$
- System.out.println(Messages.getString("RSSFeedWatcherTask.GotNewNodeContents") + CL + SP + newContent); //$NON-NLS-1$
- }
-
- if (!"null".equals(action)) { //$NON-NLS-1$
- commandline =
- (debug>0?"-debug " + debug + SP:NS) + ("null".equals(commandline)?NS:commandline) + //$NON-NLS-1$ //$NON-NLS-2$
- " -feedURL " + feedURL + //$NON-NLS-1$
- " -xpath \"" + xpath + "\"" + //$NON-NLS-1$ //$NON-NLS-2$
- " -oldvalue \"" + oldContent + "\"" + //$NON-NLS-1$ //$NON-NLS-2$
- " -newvalue \"" + newContent + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // store actual value - either the changed value or the original value (if unchanged)
- this.getProject().setProperty(feedWatchActionTheValue + DOT + j,!isNullString(newContent)?newContent:oldContent);
-
- if (newFeedWatcher.getFoundNode() == null || // changed from exists to not exists, or
- !oldContent.equals(newContent) // node has changed
- ) {
- // collect property from newNode and pass it to THIS task so that the local ant script can see it
- if (!isNullString(oldContent)) { this.getProject().setProperty(feedWatchActionOldValue + DOT + j,oldContent); }
- if (!isNullString(newContent)) { this.getProject().setProperty(feedWatchActionNewValue + DOT + j,newContent); }
-
- if (!"null".equals(action)) { //$NON-NLS-1$
- System.out.println(Messages.getString("RSSFeedWatcherTask.RunExecTask") + CL + SP + action + SP + commandline); //$NON-NLS-1$
- ExecTask exec = util.runExecTask((new File(action)).getAbsolutePath(), commandline, null);
-
- // collect properties from exec task and pass them to THIS task so that the local ant script can see them
- String out = null;
-
- out = exec.getProject().getProperty(RSSFeedUtil.RUN_EXEC_TASK_ERROR);
- if (!isNullString(out)) { this.getProject().setProperty(feedWatchActionError + DOT + j, out); }
-
- out = exec.getProject().getProperty(RSSFeedUtil.RUN_EXEC_TASK_RESULT);
- if (!isNullString(out)) { this.getProject().setProperty(feedWatchActionOuput + DOT + j, out); }
-
- out = exec.getProject().getProperty(RSSFeedUtil.RUN_EXEC_TASK_RESULT);
- if (!RSSFeedUtil.EXPECTED_RESULT.equals(out)) { this.getProject().setProperty(feedWatchActionResult + DOT + j, out); }
- }
- } else {
- System.out.println(Messages.getString("RSSFeedWatcherTask.NodeUnchanged")); //$NON-NLS-1$
- }
- } else {
- System.out.println(Messages.getString("RSSFeedWatcherTask.NodeNotFound")); //$NON-NLS-1$
- }
- j++;
- }
-
- try
- {
- RSSFeedUtil.transferData(new FileInputStream(tmpFile), new FileOutputStream(file));
- tmpFile.deleteOnExit();
- }
- catch (FileNotFoundException e)
- {
- e.printStackTrace();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
- }
-
- private void downloadFeed(File destFile, boolean verbose)
- {
- try
- {
- if (verbose) {
- System.out.println(Messages.getString("RSSFeedWatcherTask.Download") + CL + SP + feedURL); //$NON-NLS-1$
- System.out.println(Messages.getString("RSSFeedWatcherTask.To") + CL + SP + destFile + SP); //$NON-NLS-1$
- }
- RSSFeedUtil.transferData((new URL(feedURL)).openStream(), new FileOutputStream(destFile));
- if (verbose) {
- System.out.println(Messages.getString("RSSFeedWatcherTask.Done")); //$NON-NLS-1$
- System.out.println(SP);
- }
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
- catch (FileNotFoundException e)
- {
- e.printStackTrace();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
-
- private static boolean isNullString(String str)
- {
- return RSSFeedUtil.isNullString(str);
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/Messages.java b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/Messages.java
deleted file mode 100644
index bd50cc7..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/Messages.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- * /
- *******************************************************************************/
-package org.eclipse.releng.util.rss;
-
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-
-public class Messages
-{
- private static final String BUNDLE_NAME = "org.eclipse.releng.util.rss.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages()
- {
- }
-
- public static String getString(String key)
- {
- try
- {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e)
- {
- return '!' + key + '!';
- }
- }
-}
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/RSSFeedUtil.java b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/RSSFeedUtil.java
deleted file mode 100644
index f933f76..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/RSSFeedUtil.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.releng.util.rss;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.ExecTask;
-import org.apache.tools.ant.types.Commandline.Argument;
-
-/**
- *
- * Helper methods
- *
- * @author nickb
- *
- */
-public class RSSFeedUtil {
-
- private static final String SP = " "; //$NON-NLS-1$
- private static final String CL = ":"; //$NON-NLS-1$
- public static final String EXPECTED_RESULT = "0"; //$NON-NLS-1$
-
- public static final String RUN_EXEC_TASK_ERROR = "runExecTask.Error"; //$NON-NLS-1$
- public static final String RUN_EXEC_TASK_OUTPUT = "runExecTask.Output"; //$NON-NLS-1$
- public static final String RUN_EXEC_TASK_RESULT = "runExecTask.Result"; //$NON-NLS-1$
-
- private int debug = 0;
-
- /**
- * A buffer.
- */
- private static byte[] buffer = new byte [8192];
-
- public ExecTask runExecTask(String executable, String commandline, String dir)
- {
- if (dir==null) {
- dir = "."; //$NON-NLS-1$
- }
-
- ExecTask exec = new ExecTask();
- exec.setExecutable(executable);
- exec.setResolveExecutable(true);
- exec.setDir((new File(dir)).getAbsoluteFile());
- Project project = new Project(); project.setName(executable);
- exec.setProject(project);
- exec.setFailIfExecutionFails(true);
- exec.setFailonerror(true);
- exec.setErrorProperty(RUN_EXEC_TASK_ERROR);
- exec.setOutputproperty(RUN_EXEC_TASK_OUTPUT);
- exec.setResultProperty(RUN_EXEC_TASK_RESULT);
- exec.setLogError(true);
-
- if (commandline != null || "".equals(commandline)) { //$NON-NLS-1$
- Argument execArg = exec.createArg();
- execArg.setLine(commandline);
- }
- try
- {
- if (debug>0) {
- System.out.println(Messages.getString("RSSFeedPublisherTask.Execute") + SP + executable + (commandline==null?"":SP + commandline)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- exec.execute();
- handleExecTaskReturn(project);
- }
- catch (Exception e)
- {
- handleExecTaskReturn(project);
- System.err.println(Messages.getString("RSSFeedPublisherTask.ForProject") + SP + project.getName() + CL); //$NON-NLS-1$
- e.printStackTrace();
- }
-
- return exec;
-
- }
-
- private void handleExecTaskReturn(Project project)
- {
- String out = null;
-
- out = project.getProperty(RUN_EXEC_TASK_RESULT);
- if (debug>1) {
- if (!isNullString(out) && !EXPECTED_RESULT.equals(out)) {
- System.err.println(Messages.getString("RSSFeedPublisherTask.Result") + SP + out); //$NON-NLS-1$
- }
- }
-
- out = project.getProperty(RUN_EXEC_TASK_OUTPUT);
- if (!isNullString(out)) {
- System.out.println(out);
- }
-
- out = project.getProperty(RUN_EXEC_TASK_ERROR);
- if (!isNullString(out)) {
- if (debug>1 && out.equals(Messages.getString("RSSFeedPublisherTask.CVSWarning"))) { //$NON-NLS-1$
- System.out.println(out);
- } else if (!out.equals(Messages.getString("RSSFeedPublisherTask.CVSWarning"))) { //$NON-NLS-1$
- System.err.println(Messages.getString("RSSFeedPublisherTask.Error") + SP + out); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Copies all bytes in the given source stream to the given destination
- * stream. Neither streams are closed.
- *
- * From: org.eclipse.emf/tests/org.eclipse.emf.test.build/src/org/eclipse/emf/test/build/FileTool.java,v 1.2
- *
- * @param source
- * the given source stream
- * @param destination
- * the given destination stream
- */
- public static void transferData(InputStream source, OutputStream destination) throws IOException
- {
- int bytesRead = 0;
- while (bytesRead != -1)
- {
- bytesRead = source.read(buffer, 0, buffer.length);
- if (bytesRead != -1)
- {
- destination.write(buffer, 0, bytesRead);
- }
- }
- }
-
- public static boolean isNullString(String str)
- {
- return str==null||"".equals(str); //$NON-NLS-1$
- }
-
- public void setDebug(int debug)
- {
- this.debug = debug;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/messages.properties b/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/messages.properties
deleted file mode 100644
index 7a57db3..0000000
--- a/bundles/org.eclipse.build.tools/src_rss/org/eclipse/releng/util/rss/messages.properties
+++ /dev/null
@@ -1,80 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 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
-###############################################################################
-RSSFeedCommon.FileError=Error: no output file specified for feed, eg., ./feed.xml\!
-RSSFeedWatcherTask.with=\ with
-RSSFeedWatcherTask.To=To
-RSSFeedWatcherTask.Done=Done.
-RSSFeedCommon.ProjectError=Error: no project name specified, eg., EMF or WTP\!
-RSSFeedCommon.FeedURLError=Error: no feedURL specified, eg., http://server/path/to/feed.xml\!
-RSSFeedCommon.RSSFeedFile=RSS Feed file
-RSSFeedCommon.ToBePublishedAt=to be published at:
-RSSFeedCommon.Set=Set
-RSSFeedCommon.XpathError=Error: no xpath string to search for, eg., /*/*[name() = 'entry'][1]/*[name() = 'updated']/text()
-
-RSSFeedCreateFeedTask.Creating=Creating
-RSSFeedCreateFeedTask.Builds=Builds
-RSSFeedCreateFeedTask.BuildTeam=Build Team
-RSSFeedCreateFeedTask.UnableToWriteToFile=Unable to write to file
-
-RSSFeedAddEntryTask.BranchError=Warning: no branch specified, eg., 3.2.0\!
-RSSFeedAddEntryTask.BuildIDError=Warning: no buildID specified, eg., S200506071234\!
-RSSFeedAddEntryTask.BuildURLError=Warning: no buildURL specified, eg., http://server/path/to/project/downloads/drops/branch/buildID/\!
-RSSFeedAddEntryTask.AddingEntryTo=Adding entry to
-
-RSSFeedAddEntryTask.DoesNotExist=does not exist. Creating ...
-RSSFeedAddEntryTask.AnnouncePrefix=[announce]
-RSSFeedAddEntryTask.IsAvailable=is available
-RSSFeedAddEntryTask.InProperty=in property
-RSSFeedAddEntryTask.AttachNew=Attach new
-RSSFeedAddEntryTask.BranchKeyword=%%branch%%
-RSSFeedAddEntryTask.BuildIDKeyword=%%buildID%%
-RSSFeedAddEntryTask.BuildAliasKeyword=%%buildAlias%%
-RSSFeedAddEntryTask.WrongNumberOfVariables=Wrong number of variables
-RSSFeedAddEntryTask.MustBeMultipleOf5=(must be multiple of 5)
-RSSFeedAddEntryTask.MustBeMultipleOf4=(must be multiple of 4)
-
-RSSFeedUpdateEntryTask.SearchingFor=Searching for
-RSSFeedUpdateEntryTask.ReplacingWith=replacing with
-RSSFeedUpdateEntryTask.DoesNotExist=does not exist. Nothing to do\!
-RSSFeedUpdateEntryTask.DebugFoundAttribute=Found Attribute:
-RSSFeedUpdateEntryTask.DebugFoundElement=Found Element:
-RSSFeedUpdateEntryTask.DebugFoundText=Found Text:
-RSSFeedUpdateEntryTask.XpathNodeNotFound=Xpath Node Not Found\!
-RSSFeedUpdateEntryTask.DebugGotATNode=Got A/T Node:
-RSSFeedUpdateEntryTask.DebugGotENode=Got E Node:
-
-RSSFeedPublisherTask.ErrorInvalidFile=Error: invalid feed file specified
-RSSFeedPublisherTask.Error=Error:
-RSSFeedPublisherTask.Publish=Publish
-RSSFeedPublisherTask.Execute=Execute:
-RSSFeedPublisherTask.Result=Result:
-RSSFeedPublisherTask.ForProject=For project
-RSSFeedPublisherTask.UsingCVSRoot=Using CVS Root:
-RSSFeedPublisherTask.UsingCVSPath=Using CVS Path:
-RSSFeedPublisherTask.UsingCVSTemp=Using CVS Temp:
-RSSFeedPublisherTask.PublishToSCPTarget=Publish to SCP Target:
-RSSFeedPublisherTask.ErrorNothingToDo=Error\! Must specify SCP and/or CVS options to publish a feed file. Nothing to do\!
-RSSFeedPublisherTask.ErrorCouldNotDeleteTempFolder=Error: could not delete temp folder
-RSSFeedPublisherTask.CVSWarning=cvs add: use `cvs commit' to add this file permanently
-
-RSSFeedWatcherTask.ErrorNoWatchActions=Error\! Must specify for which feed changes to watch and what actions as response. Nothing to do\!
-RSSFeedWatcherTask.PleaseRunThisTaskLater=Please run this task at some later date to compare reference copy in
-RSSFeedWatcherTask.WarningNoScriptAction=Warning: Assuming no script action for
-RSSFeedWatcherTask.WarningNoCommandlineParams=Warning: Assuming no commandline params for
-RSSFeedWatcherTask.ToTheLatestVersion=to latest version of feed in
-RSSFeedWatcherTask.ErrorDestinationFileIsADirectory=Error\! Destination file exists as a directory\! Cannot proceed.
-RSSFeedWatcherTask.Compare=Compare
-RSSFeedWatcherTask.GotOldNodeContents=Got old node contents
-RSSFeedWatcherTask.GotNewNodeContents=Got new node contents
-RSSFeedWatcherTask.RunExecTask=Run Exec Task
-RSSFeedWatcherTask.NodeUnchanged=Node unchanged. Nothing to do\!
-RSSFeedWatcherTask.NodeNotFound=Node not found. Nothing to do\!
-RSSFeedWatcherTask.Download=Download