View | Details | Raw Unified | Return to bug 143457
Collapse All | Expand All

(-)build.properties (-1 / +2 lines)
Lines 15-21 Link Here
15
               about.html,\
15
               about.html,\
16
               icons/,\
16
               icons/,\
17
               .,\
17
               .,\
18
               META-INF/
18
               META-INF/,\
19
               ant_tasks/resources-ant.jar
19
src.includes = about.html,\
20
src.includes = about.html,\
20
               schema/
21
               schema/
21
source.. = extensions/,\
22
source.. = extensions/,\
(-).project (-1 / +10 lines)
Lines 16-28 Link Here
16
			</arguments>
16
			</arguments>
17
		</buildCommand>
17
		</buildCommand>
18
		<buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
20
			<arguments>
21
				<dictionary>
22
					<key>LaunchConfigHandle</key>
23
					<value>&lt;project&gt;/.externalToolBuilders/Build resources-ant.jar.launch</value>
24
				</dictionary>
25
			</arguments>
26
		</buildCommand>
27
		<buildCommand>
19
			<name>org.eclipse.pde.SchemaBuilder</name>
28
			<name>org.eclipse.pde.SchemaBuilder</name>
20
			<arguments>
29
			<arguments>
21
			</arguments>
30
			</arguments>
22
		</buildCommand>
31
		</buildCommand>
23
	</buildSpec>
32
	</buildSpec>
24
	<natures>
33
	<natures>
25
		<nature>org.eclipse.pde.PluginNature</nature>
26
		<nature>org.eclipse.jdt.core.javanature</nature>
34
		<nature>org.eclipse.jdt.core.javanature</nature>
35
		<nature>org.eclipse.pde.PluginNature</nature>
27
	</natures>
36
	</natures>
28
</projectDescription>
37
</projectDescription>
(-).classpath (+1 lines)
Lines 2-7 Link Here
2
<classpath>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="src" path="extensions"/>
4
	<classpathentry kind="src" path="extensions"/>
5
	<classpathentry kind="src" path="src_ant"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
6
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
6
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
7
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
7
	<classpathentry kind="output" path="bin"/>
8
	<classpathentry kind="output" path="bin"/>
(-).cvsignore (-1 / +2 lines)
Line 1 Link Here
1
bin
1
bin
2
temp.folder
(-)plugin.xml (+25 lines)
Lines 2041-2045 Link Here
2041
            type="org.eclipse.ui.internal.views.markers.ExtendedMarkersView">
2041
            type="org.eclipse.ui.internal.views.markers.ExtendedMarkersView">
2042
      </propertyTester>
2042
      </propertyTester>
2043
   </extension>
2043
   </extension>
2044
   <!-- Tasks -->
2045
   <extension
2046
         point="org.eclipse.ant.core.antTasks">
2047
      <antTask
2048
            library="ant_tasks/resources-ant.jar"
2049
            name="eclipse.importPreferences"
2050
            headless="true"
2051
            eclipseRuntime="true"
2052
            class="org.eclipse.ui.ide.anttasks.ImportPreferencesTask">
2053
      </antTask>
2054
      <antTask
2055
            library="ant_tasks/resources-ant.jar"
2056
            name="eclipse.exportPreferences"
2057
            eclipseRuntime="true"
2058
            headless="true"
2059
            class="org.eclipse.ui.ide.anttasks.ExportPreferencesTask">
2060
      </antTask>
2061
   </extension>
2062
<!-- Extra Classpath -->
2063
   <extension
2064
         point="org.eclipse.ant.core.extraClasspathEntries">
2065
      <extraClasspathEntry
2066
            library="ant_tasks/resources-ant.jar">
2067
      </extraClasspathEntry>
2068
   </extension>
2044
   
2069
   
2045
</plugin>
2070
</plugin>
(-)META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 54-60 Link Here
54
 org.eclipse.update.core;bundle-version="[3.1.100,4.0.0)",
54
 org.eclipse.update.core;bundle-version="[3.1.100,4.0.0)",
55
 org.eclipse.update.ui;bundle-version="[3.1.100,4.0.0)",
55
 org.eclipse.update.ui;bundle-version="[3.1.100,4.0.0)",
56
 org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
56
 org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
57
 org.eclipse.ui.forms;bundle-version="[3.3.0,4.0.0)"
57
 org.eclipse.ui.forms;bundle-version="[3.3.0,4.0.0)",
58
 org.apache.ant,
59
 org.eclipse.ant.core
58
Eclipse-LazyStart: true
60
Eclipse-LazyStart: true
59
Import-Package: com.ibm.icu.text
61
Import-Package: com.ibm.icu.text
60
Bundle-RequiredExecutionEnvironment: J2SE-1.4
62
Bundle-RequiredExecutionEnvironment: J2SE-1.4
(-)src_ant/META-INF/eclipse.inf (+1 lines)
Added Link Here
1
jarprocessor.exclude.sign=true
(-).externalToolBuilders/Build (+17 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
3
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
4
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
5
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
6
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/>
7
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
8
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
9
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
10
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
11
<booleanAttribute key="org.eclipse.debug.core.capture_output" value="true"/>
12
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/>
13
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/org.eclipse.ui.ide/scripts/buildExtraJAR.xml&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/org.eclipse.ui.ide/src_ant&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;&#10;}"/>
14
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
15
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.ui.ide/scripts/buildExtraJAR.xml}"/>
16
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_SHOW_CONSOLE" value="true"/>
17
</launchConfiguration>
(-)scripts/buildExtraJAR.xml (+58 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project name="org.eclipse.ui.ide" default="main" basedir="..">
3
4
	<target name="main" depends="clean, ant_tasks/resources-ant.jar">
5
	</target>
6
7
	<target name="init" depends="properties">
8
		<property name="plugin" value="org.eclipse.ui.ide"/>
9
		<property name="temp.folder" value="${basedir}/temp.folder"/>
10
		<property name="plugin.destination" value="${basedir}"/>
11
		<property name="build.result.folder" value="${basedir}/ant_tasks"/>
12
		<property name="version.suffix" value="_3.1.0"/>
13
	</target>
14
15
	<target name="properties" if="eclipse.running">
16
		<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
17
	</target>
18
19
	<target name="ant_tasks/resources-ant.jar" depends="init" unless="ant_tasks/resources-ant.jar">
20
		<property name="destdir" value="${temp.folder}/ant_tasks/resources-ant.jar.bin"/>
21
		<delete dir="${temp.folder}/ant_tasks/resources-ant.jar.bin"/>
22
		<mkdir dir="${temp.folder}/ant_tasks/resources-ant.jar.bin"/>
23
		<!-- compile the source code -->
24
		<javac destdir="${temp.folder}/ant_tasks/resources-ant.jar.bin" failonerror="true" verbose="true" debug="on">
25
			<classpath>
26
				<dirset dir="${basedir}/..">
27
					<include name="org.eclipse.core.runtime/bin"/>
28
					<include name="org.eclipse.equinox.common/bin"/>
29
					<include name="org.eclipse.core.jobs/bin"/>
30
					<include name="org.eclipse.osgi/bin"/>
31
					<include name="org.eclipse.ant.core/bin"/>
32
				</dirset>
33
				<fileset dir="${eclipse.home}">
34
					<include name="plugins/org.eclipse.core.runtime*.jar"/>
35
					<include name="plugins/org.eclipse.equinox.common*.jar"/>
36
					<include name="plugins/org.eclipse.equinox.preferences*.jar"/>
37
					<include name="plugins/org.eclipse.core.jobs*.jar"/>
38
					<include name="plugins/org.eclipse.osgi*.jar"/>
39
					<include name="plugins/org.eclipse.ant.core*.jar"/>
40
				</fileset>
41
			</classpath>
42
			<src path="src_ant/"/>
43
		</javac>
44
		<!-- copy necessary resources -->
45
		<copy todir="${temp.folder}/ant_tasks/resources-ant.jar.bin">
46
			<fileset dir="src_ant/" excludes="**/*.java"/>
47
		</copy>
48
		<mkdir dir="${build.result.folder}"/>
49
		<jar jarfile="${build.result.folder}/resources-ant.jar" basedir="${temp.folder}/ant_tasks/resources-ant.jar.bin"/>
50
		<delete dir="${temp.folder}/ant_tasks/resources-ant.jar.bin"/>
51
		<delete dir="${temp.folder}"/>
52
	</target>
53
54
	<target name="clean" depends="init">
55
		<delete file="${build.result.folder}/resources-ant.jar"/>
56
		<delete dir="${temp.folder}"/>
57
	</target>
58
</project>
(-)src_ant/org/eclipse/ui/ide/anttasks/ExportPreferencesTask.java (+53 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.ui.ide.anttasks;
12
13
import java.io.*;
14
import org.apache.tools.ant.BuildException;
15
import org.eclipse.ant.core.Task;
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.Platform;
18
import org.eclipse.core.runtime.preferences.IPreferencesService;
19
20
/**
21
 * An ant task which exports preferences from specified file.
22
 * 
23
 * @see IPreferencesService#importPreferences(InputStream)
24
 */
25
public class ExportPreferencesTask extends Task {
26
27
	private String preferencesPath;
28
29
	/**
30
	 * Sets the path to the preference file.
31
	 * @param path A string pointing to the file
32
	 */
33
	public void setPreferencesFile(String path) {
34
		preferencesPath = path;
35
	}
36
37
	/**
38
	 * Performs the preferences export.
39
	 * @throws BuildException thrown if a problem occurs during execution.
40
	 */
41
	public final void execute() throws BuildException {
42
		try {
43
			OutputStream os = new BufferedOutputStream(new FileOutputStream(preferencesPath));
44
			IPreferencesService service = Platform.getPreferencesService();
45
			service.exportPreferences(service.getRootNode(), os, null);
46
		} catch (FileNotFoundException e) {
47
			//should not happen
48
			throw new BuildException(e);
49
		} catch (CoreException e) {
50
			throw new BuildException(e);
51
		}
52
	}
53
}
(-)src_ant/org/eclipse/ui/ide/anttasks/ImportPreferencesTask.java (+53 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.ui.ide.anttasks;
12
13
import java.io.*;
14
import org.apache.tools.ant.BuildException;
15
import org.eclipse.ant.core.Task;
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.Platform;
18
import org.eclipse.core.runtime.preferences.IPreferencesService;
19
20
/**
21
 * An ant task which imports preferences from specified file.
22
 * 
23
 * @see IPreferencesService#importPreferences(InputStream)
24
 */
25
public class ImportPreferencesTask extends Task {
26
	
27
	private String preferencesPath;
28
29
	/**
30
	 * Sets the path to the preference file.
31
	 * @param path A string pointing to the file
32
	 */
33
	public void setPreferencesFile(String path) {
34
		preferencesPath = path;
35
	}
36
37
	/**
38
	 * Performs the preferences import.
39
	 * @throws BuildException thrown if a problem occurs during execution.
40
	 */
41
	public final void execute() throws BuildException {
42
		try {
43
			InputStream is = new BufferedInputStream(new FileInputStream(preferencesPath));
44
			IPreferencesService service = Platform.getPreferencesService();
45
			service.importPreferences(is);
46
		} catch (FileNotFoundException e) {
47
			//should not happen
48
			throw new BuildException(e);
49
		} catch (CoreException e) {
50
			throw new BuildException(e);
51
		}
52
	}
53
}

Return to bug 143457