Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Knauer2007-09-26 13:01:11 +0000
committerMarkus Knauer2007-09-26 13:01:11 +0000
commit66b6631b08744f87f3634e00f5689fd07773ca7a (patch)
tree37cff804af3dcec1c68ecba5e4a55b72686795dc /plugins
parentd1757b4082f6bbd05c021364b6c758c964352e9c (diff)
downloadorg.eclipse.epp.packages-66b6631b08744f87f3634e00f5689fd07773ca7a.tar.gz
org.eclipse.epp.packages-66b6631b08744f87f3634e00f5689fd07773ca7a.tar.xz
org.eclipse.epp.packages-66b6631b08744f87f3634e00f5689fd07773ca7a.zip
Updates for Eclipse 3.3 based build environmentI20070925
* platform specific eclipse.ini content is taken from XML file * plugin_customization.ini - default perspective in XML file * config.ini - product in XML file
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.epp.packaging.core/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/EclipsePackagingExecutor.java9
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/CustomTargetsWriter.java36
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/EclipsePackager.java2
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IModifiablePackagerConfiguration.java3
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPackagerConfiguration.java4
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPlatform.java3
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/PackagerConfiguration.java53
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/Platform.java12
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser.java14
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/IXmlElement.java2
-rw-r--r--plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java4
12 files changed, 115 insertions, 31 deletions
diff --git a/plugins/org.eclipse.epp.packaging.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.epp.packaging.core/META-INF/MANIFEST.MF
index 2b53d4ef..6514f76b 100644
--- a/plugins/org.eclipse.epp.packaging.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.epp.packaging.core/META-INF/MANIFEST.MF
@@ -8,7 +8,9 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ant.core,
- org.eclipse.update.core
+ org.eclipse.update.core,
+ org.eclipse.pde.build,
+ org.apache.ant
Export-Package: org.eclipse.epp.packaging.core,
org.eclipse.epp.packaging.core.assembly,
org.eclipse.epp.packaging.core.configuration,
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/EclipsePackagingExecutor.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/EclipsePackagingExecutor.java
index a3e8402a..e6f1734c 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/EclipsePackagingExecutor.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/EclipsePackagingExecutor.java
@@ -14,6 +14,7 @@ import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.epp.packaging.core.assembly.EclipsePackager;
+import org.eclipse.epp.packaging.core.assembly.IPackager;
import org.eclipse.epp.packaging.core.assembly.InstallerPackager;
import org.eclipse.epp.packaging.core.assembly.PackageMover;
import org.eclipse.epp.packaging.core.configuration.ICommands;
@@ -61,9 +62,11 @@ public class EclipsePackagingExecutor {
private void build() throws IOException, CoreException {
if( commands.mustDo( Task.BUILD ) ) {
MessageLogger.getInstance().logBeginProcess( "Application.Building" ); //$NON-NLS-1$
- new EclipsePackager( configuration ).packApplication();
- new PackageMover( configuration ).moveFiles();
- new InstallerPackager( configuration ).packApplication();
+ IPackager packager = new EclipsePackager( this.configuration );
+ packager.packApplication();
+ PackageMover mover = new PackageMover( this.configuration );
+ mover.moveFiles();
+// new InstallerPackager( configuration ).packApplication();
MessageLogger.getInstance().logEndProcess();
}
}
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/CustomTargetsWriter.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/CustomTargetsWriter.java
index 4aa70fc8..10111bd6 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/CustomTargetsWriter.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/CustomTargetsWriter.java
@@ -52,16 +52,42 @@ public class CustomTargetsWriter {
* @param platform
*/
public void addTargetFileForPlatform( final IPlatform platform ) {
- this.writer.append( "<target name=\"assemble." //$NON-NLS-1$
+ this.writer.append( " <target name=\"assemble." //$NON-NLS-1$
+ platform.toString( '.' )
+ ".xml\" depends=\"init\">\n" ); //$NON-NLS-1$
- this.writer.append( "<ant antfile=\"${assembleScriptName}\" >\n" ); //$NON-NLS-1$
- this.writer.append( "<property name=\"archiveName\" value=\"" //$NON-NLS-1$
+
+ this.writer.append( " <replaceregexp file=\"${tempDirectory}/" //$NON-NLS-1$
+ + platform.toString( '.' )
+ + "/eclipse/configuration/config.ini\"\n" ); //$NON-NLS-1$
+ this.writer.append( " match=\"eclipse.product=(.*)\"\n" ); //$NON-NLS-1$
+ this.writer.append( " replace=\"eclipse.product=" //$NON-NLS-1$
+ + this.configuration.getEclipseProductId()
+ + "\"\n" ); //$NON-NLS-1$
+ this.writer.append( " byline=\"true\" />\n" ); //$NON-NLS-1$
+
+ this.writer.append( " <replaceregexp byline=\"true\">\n" ); //$NON-NLS-1$
+ this.writer.append( " <regexp pattern=\"org.eclipse.ui/defaultPerspectiveId=(.*)\"/>\n" ); //$NON-NLS-1$
+ this.writer.append( " <substitution expression=\"org.eclipse.ui/defaultPerspectiveId=" //$NON-NLS-1$
+ + this.configuration.getInitialPerspectiveId()
+ + "\"/>\n" ); //$NON-NLS-1$
+ this.writer.append( " <fileset dir=\"${tempDirectory}/eclipse/plugins/\" includes=\"" //$NON-NLS-1$
+// + this.configuration.getEclipseProductId()
+ + "*/plugin_customization.ini\"/>\n" ); //$NON-NLS-1$
+ this.writer.append( " </replaceregexp>\n" ); //$NON-NLS-1$
+
+ this.writer.append( " <echo file=\"${tempDirectory}/" //$NON-NLS-1$
+ + platform.toString( '.' )
+ + "/eclipse/eclipse.ini\">" ); //$NON-NLS-1$
+ this.writer.append( platform.getEclipseIniFileContent() );
+ this.writer.append( " </echo>\n" ); //$NON-NLS-1$
+
+ this.writer.append( " <ant antfile=\"${assembleScriptName}\" >\n" ); //$NON-NLS-1$
+ this.writer.append( " <property name=\"archiveName\" value=\"" //$NON-NLS-1$
+ platform.getTargetFileName( this.configuration )
+ platform.getArchiveFormat().getExtension()
+ "\"/>\n" ); //$NON-NLS-1$
- this.writer.append( "</ant>\n" ); //$NON-NLS-1$
- this.writer.append( "</target>\n" ); //$NON-NLS-1$
+ this.writer.append( " </ant>\n" ); //$NON-NLS-1$
+ this.writer.append( " </target>\n" ); //$NON-NLS-1$
}
/**
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/EclipsePackager.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/EclipsePackager.java
index 577f0353..3cef849d 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/EclipsePackager.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/assembly/EclipsePackager.java
@@ -80,7 +80,7 @@ public class EclipsePackager implements IPackager {
final PackagingPropertiesWriter propertiesWriter )
{
mapWriter.addCustomFileForAllPlatforms( filename );
- propertiesWriter.addFileToOrder( filename );
+// propertiesWriter.addFileToOrder( filename );
}
private void zipConfig( final File parentFolder,
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IModifiablePackagerConfiguration.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IModifiablePackagerConfiguration.java
index c4b94ed4..b8347d52 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IModifiablePackagerConfiguration.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IModifiablePackagerConfiguration.java
@@ -38,7 +38,8 @@ public interface IModifiablePackagerConfiguration
/**Adds a new target platform.*/
public Platform addTargetPlatform( final String os,
final String ws,
- final String arch );
+ final String arch,
+ final String eclipseIniFileContent );
/**Sets the RCP version to use.*/
public void setRcpVersion( final String version );
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPackagerConfiguration.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPackagerConfiguration.java
index ae6be3a2..bcd9d089 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPackagerConfiguration.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPackagerConfiguration.java
@@ -40,4 +40,8 @@ public interface IPackagerConfiguration {
public File getConfigIni();
public String getProductName();
+
+ public String getEclipseProductId();
+
+ public String getInitialPerspectiveId();
} \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPlatform.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPlatform.java
index 42c405bd..f2f7254e 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPlatform.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/IPlatform.java
@@ -45,4 +45,7 @@ public interface IPlatform {
/** Returns the name installer-creating script most suitable for this platform. */
public String getInstallScriptName();
+
+ /** Returns a string with the content of the eclipse.ini file */
+ public String getEclipseIniFileContent();
}
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/PackagerConfiguration.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/PackagerConfiguration.java
index c5624586..5a1751c6 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/PackagerConfiguration.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/PackagerConfiguration.java
@@ -33,6 +33,8 @@ public class PackagerConfiguration implements IModifiablePackagerConfiguration {
private File rootFolder;
private File configIni;
private String productName;
+ private String eclipseProductId;
+ private String initialPerspectiveId;
private String installerConfigurationFolder;
public PackagerConfiguration() {
@@ -40,24 +42,24 @@ public class PackagerConfiguration implements IModifiablePackagerConfiguration {
}
public URL[] getUpdateSites() {
- return updateSites.toArray( new URL[ updateSites.size() ] );
+ return this.updateSites.toArray( new URL[ this.updateSites.size() ] );
}
public void addUpdateSite( final String string ) throws MalformedURLException
{
- updateSites.add( new URL( string ) );
+ this.updateSites.add( new URL( string ) );
}
public VersionedIdentifier[] getRequiredFeatures() {
- return requiredFeatures.toArray( new VersionedIdentifier[ requiredFeatures.size() ] );
+ return this.requiredFeatures.toArray( new VersionedIdentifier[ requiredFeatures.size() ] );
}
public void addRequiredFeature( final String id, final String version ) {
- requiredFeatures.add( new VersionedIdentifier( id, version ) );
+ this.requiredFeatures.add( new VersionedIdentifier( id, version ) );
}
public File getPackagerConfigurationFolder() {
- return packagerConfigurationFolder;
+ return this.packagerConfigurationFolder;
}
public void setPackagerConfigurationFolder( final String folder ) {
@@ -65,36 +67,37 @@ public class PackagerConfiguration implements IModifiablePackagerConfiguration {
}
public File getTargetFolder() {
- return baseFolder;
+ return this.baseFolder;
}
public void setExtensionSiteRelative( final String relativeFolder ) {
- this.extensionSite = new File( baseFolder, relativeFolder );
+ this.extensionSite = new File( this.baseFolder, relativeFolder );
}
public File getExtensionSite() {
- return extensionSite;
+ return this.extensionSite;
}
public Platform addTargetPlatform( final String os,
final String ws,
- final String arch )
+ final String arch,
+ final String eclipseIniFileContent )
{
- Platform platform = new Platform( os, ws, arch );
- targetPlatforms.add( platform );
+ Platform platform = new Platform( os, ws, arch, eclipseIniFileContent );
+ this.targetPlatforms.add( platform );
return platform;
}
public IPlatform[] getTargetPlatforms() {
- return targetPlatforms.toArray( new IPlatform[ targetPlatforms.size() ] );
+ return this.targetPlatforms.toArray( new IPlatform[ targetPlatforms.size() ] );
}
public String getRootFileBaseName() {
- return "eclipse-RCP-" + rcpVersion + '-'; //$NON-NLS-1$
+ return "eclipse-RCP-" + this.rcpVersion + '-'; //$NON-NLS-1$
}
public File getRootFileFolder() {
- return rootFolder;
+ return this.rootFolder;
}
public void setRcpVersion( final String version ) {
@@ -106,7 +109,7 @@ public class PackagerConfiguration implements IModifiablePackagerConfiguration {
}
public File getConfigIni() {
- return configIni;
+ return this.configIni;
}
public void setConfigIni( final String fileName ) {
@@ -118,14 +121,30 @@ public class PackagerConfiguration implements IModifiablePackagerConfiguration {
}
public String getProductName() {
- return productName;
+ return this.productName;
}
public String getInstallerConfigurationFolder() {
- return installerConfigurationFolder;
+ return this.installerConfigurationFolder;
}
public void setInstallerConfigurationFolder( final String folder ) {
this.installerConfigurationFolder = folder;
}
+
+ public void setEclipseProductId( final String eclipseProductId ) {
+ this.eclipseProductId = eclipseProductId;
+ }
+
+ public String getEclipseProductId() {
+ return this.eclipseProductId;
+ }
+
+ public void setInitialPerspectiveId( final String initialPerspectiveId ) {
+ this.initialPerspectiveId = initialPerspectiveId;
+ }
+
+ public String getInitialPerspectiveId() {
+ return this.initialPerspectiveId;
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/Platform.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/Platform.java
index 9f31cdfa..d95d5fa9 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/Platform.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/Platform.java
@@ -27,12 +27,18 @@ public class Platform implements IPlatform {
private final String os;
private final String ws;
private final String arch;
+ private final String eclipseIniFileContent;
private ArchiveFormat archiveFormat = ArchiveFormat.antZip;
- public Platform( final String os, final String ws, final String arch ) {
+ public Platform( final String os,
+ final String ws,
+ final String arch,
+ final String eclipseIniFileContent )
+ {
this.os = os;
this.ws = ws;
this.arch = arch;
+ this.eclipseIniFileContent = eclipseIniFileContent;
}
@Override
@@ -118,4 +124,8 @@ public class Platform implements IPlatform {
}
return buildFile;
}
+
+ public String getEclipseIniFileContent() {
+ return eclipseIniFileContent;
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser.java
index b013a1cc..54539547 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser.java
@@ -50,6 +50,9 @@ public class ConfigurationParser {
private static final String TAG_PRODUCT = "product"; //$NON-NLS-1$
private static final String ATTRIB_CONFIG_INI = "configIni"; //$NON-NLS-1$
private static final String ATTRIB_NAME = "name"; //$NON-NLS-1$
+ private static final String ATTRIB_ECLIPSE_PRODUCT_ID = "eclipseProductId"; //$NON-NLS-1$
+ private static final String ATTRIB_INITIAL_PERSPECTIVE_ID = "initialPerspectiveId"; //$NON-NLS-1$
+ private static final String TAG_ECLIPSE_INI_FILE = "eclipseIniFileContent"; //$NON-NLS-1$
/**
* Parses the configuration contained in xmlFile.
@@ -103,9 +106,14 @@ public class ConfigurationParser {
final IXmlElement parent )
{
IXmlElement productElement = parent.getElement( TAG_PRODUCT );
- configuration.setProductName( productElement.getAttributeValue( ATTRIB_NAME ) );
+ String productName = productElement.getAttributeValue( ATTRIB_NAME );
+ configuration.setProductName( productName );
String configIni = productElement.getAttributeValue( ATTRIB_CONFIG_INI );
configuration.setConfigIni( configIni );
+ String eclipseProductId = productElement.getAttributeValue( ATTRIB_ECLIPSE_PRODUCT_ID );
+ configuration.setEclipseProductId( eclipseProductId );
+ String initialPerspectiveId = productElement.getAttributeValue( ATTRIB_INITIAL_PERSPECTIVE_ID );
+ configuration.setInitialPerspectiveId( initialPerspectiveId );
}
/** Loads and sets the target platforms. */
@@ -117,7 +125,9 @@ public class ConfigurationParser {
String os = platformElement.getAttributeValue( ATTRIB_OS );
String ws = platformElement.getAttributeValue( ATTRIB_WS );
String arch = platformElement.getAttributeValue( ATTRIB_ARCH );
- Platform platform = configuration.addTargetPlatform( os, ws, arch );
+ IXmlElement eclipseIniFileElement = platformElement.getElement( TAG_ECLIPSE_INI_FILE );
+ String eclipseIniFileContent = eclipseIniFileElement.getText();
+ Platform platform = configuration.addTargetPlatform( os, ws, arch, eclipseIniFileContent );
IXmlElement archiveFormat = platformElement.getElement( TAG_ARCHIVE_FORMAT );
if( archiveFormat != null ) {
platform.setArchiveFormat( archiveFormat.getAttributeValue( ATTRIB_FORMAT ) );
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/IXmlElement.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/IXmlElement.java
index afff8db1..f8b234c9 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/IXmlElement.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/IXmlElement.java
@@ -29,4 +29,6 @@ public interface IXmlElement {
* if none exist.
*/
public IXmlElement getElement( String tagName );
+
+ public String getText();
}
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java
index 34cf4614..477e2920 100644
--- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java
+++ b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java
@@ -48,4 +48,8 @@ public class XmlElement implements IXmlElement {
}
return result.toArray( new IXmlElement[ result.size() ] );
}
+
+ public String getText() {
+ return this.node.getTextContent();
+ }
} \ No newline at end of file

Back to the top