Skip to main content
summaryrefslogtreecommitdiffstats
path: root/p2
diff options
context:
space:
mode:
authorDoug Schaefer2009-04-29 19:53:16 -0400
committerDoug Schaefer2009-04-29 19:53:16 -0400
commit0e9d71dcbbfcaf406a3a5283774d6b5cb4c844fb (patch)
tree6312e35d5e3fba1c3b92711e839a8e2254be4596 /p2
parentda50919f62d0186a692c93f66311f80b3d0c2a4a (diff)
downloadorg.eclipse.cdt-0e9d71dcbbfcaf406a3a5283774d6b5cb4c844fb.tar.gz
org.eclipse.cdt-0e9d71dcbbfcaf406a3a5283774d6b5cb4c844fb.tar.xz
org.eclipse.cdt-0e9d71dcbbfcaf406a3a5283774d6b5cb4c844fb.zip
Updated the Wascana generator.
Diffstat (limited to 'p2')
-rw-r--r--p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java269
1 files changed, 164 insertions, 105 deletions
diff --git a/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java b/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java
index 6ff8fa56e7..d22cedaa24 100644
--- a/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java
+++ b/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java
@@ -61,7 +61,13 @@ public class MinGWGenerator implements IApplication {
Activator.getDefault().getBundle("org.eclipse.equinox.p2.exemplarysetup").start(Bundle.START_TRANSIENT); //$NON-NLS-1$
- File repoDir = new File("E:\\Wascana\\repo");
+ String[] args = (String[])context.getArguments().get(IApplicationContext.APPLICATION_ARGS);
+ if (args.length < 1) {
+ System.err.println("usage: <repoDir>");
+ return EXIT_OK;
+ }
+
+ File repoDir = new File(args[0]);
repoDir.mkdirs();
new File(repoDir, "artifacts.xml").delete();
@@ -82,156 +88,197 @@ public class MinGWGenerator implements IApplication {
ILicense wxLic = MetadataFactory.createLicense(new URI(wxLicURL), wxLicText);
Version wascanaVersion = new Version("1.0.0");
+
String mingwSubdir = "mingw";
- // MinGW Runtime
- String runtimeId = "wascana.mingw.mingwrt";
- Version runtimeVersion = new Version("4.15.1");
- InstallableUnitDescription runtimeIUDesc = createIUDesc(runtimeId, runtimeVersion, "Wascana MinGW Runtime Library", publicDomainLic);
- IInstallableUnit runtimeIU = createIU(runtimeIUDesc, runtimeId, runtimeVersion,
- "http://downloads.sourceforge.net/mingw/mingwrt-3.15.1-mingw32.tar.gz",
+ // MinGW Runtime DLL
+ Version runtimeVersion = new Version("4.15.2");
+ IInstallableUnit runtimeDLLIU = createIU(
+ "wascana.mingw.mingwrt.dll",
+ runtimeVersion,
+ "Wascana MinGW Runtime DLL",
+ "http://downloads.sourceforge.net/mingw/mingwrt-3.15.2-mingw32-dll.tar.gz",
mingwSubdir,
- GZ_COMPRESSION);
+ GZ_COMPRESSION,
+ null,
+ publicDomainLic,
+ false);
+
+ // MinGW Runtime Library
+ IInstallableUnit runtimeLibIU = createIU(
+ "wascana.mingw.mingwrt.lib",
+ runtimeVersion,
+ "Wascana MinGW Runtime Library",
+ "http://downloads.sourceforge.net/mingw/mingwrt-3.15.2-mingw32-dev.tar.gz",
+ mingwSubdir,
+ GZ_COMPRESSION,
+ new IRequiredCapability[] {
+ createStrictRequiredCap(runtimeDLLIU)
+ },
+ publicDomainLic,
+ false);
// w32api
- String w32apiId = "wascana.mingw.w32api";
- Version w32apiVersion = new Version("3.13");
- InstallableUnitDescription w32apiIUDesc = createIUDesc(w32apiId, w32apiVersion, "Wascana MinGW Windows Library", publicDomainLic);
- IInstallableUnit w32apiIU = createIU(w32apiIUDesc, w32apiId, w32apiVersion,
+ IInstallableUnit w32apiIU = createIU(
+ "wascana.mingw.w32api",
+ new Version("3.13"),
+ "Wascana MinGW Windows Library",
"http://downloads.sourceforge.net/mingw/w32api-3.13-mingw32-dev.tar.gz",
mingwSubdir,
- GZ_COMPRESSION);
+ GZ_COMPRESSION,
+ null,
+ publicDomainLic,
+ false);
// binutils
- String binutilsId = "wascana.mingw.binutils";
- Version binutilsVersion = new Version("2.19");
- InstallableUnitDescription binutilsIUDesc = createIUDesc(binutilsId, binutilsVersion, "Wascana MinGW binutils", gplLic);
- IInstallableUnit binutilsIU = createIU(binutilsIUDesc, binutilsId, binutilsVersion,
- "http://downloads.sourceforge.net/mingw/binutils-2.19-mingw32-bin.tar.gz",
+ IInstallableUnit binutilsIU = createIU(
+ "wascana.mingw.binutils",
+ new Version("2.19.1"),
+ "Wascana MinGW binutils",
+ "http://downloads.sourceforge.net/mingw/binutils-2.19.1-mingw32-bin.tar.gz",
mingwSubdir,
- GZ_COMPRESSION);
+ GZ_COMPRESSION,
+ null,
+ gplLic,
+ false);
// gcc-4 core
- String gcc4coreId = "wascana.mingw.gcc4.core";
- Version gcc4Version = new Version("4.3.2.tdm-1");
- InstallableUnitDescription gcc4coreIUDesc = createIUDesc(gcc4coreId, gcc4Version, "Wascana MinGW gcc-4 core", gplLic);
- IRequiredCapability[] gcc4coreReqs = new IRequiredCapability[] {
- MetadataFactory.createRequiredCapability(
- IInstallableUnit.NAMESPACE_IU_ID,
- runtimeIU.getId(), new VersionRange(null), null, false, false),
- MetadataFactory.createRequiredCapability(
- IInstallableUnit.NAMESPACE_IU_ID,
- w32apiIU.getId(), new VersionRange(null), null, false, false),
- MetadataFactory.createRequiredCapability(
- IInstallableUnit.NAMESPACE_IU_ID,
- binutilsIU.getId(), new VersionRange(null), null, false, false),
- };
- gcc4coreIUDesc.setRequiredCapabilities(gcc4coreReqs);
- IInstallableUnit gcc4coreIU = createIU(gcc4coreIUDesc, gcc4coreId, gcc4Version,
- "http://downloads.sourceforge.net/tdm-gcc/gcc-4.3.2-tdm-1-core.tar.gz",
+ Version gcc4version = new Version("4.3.3.tdm-1");
+ IInstallableUnit gcc4coreIU = createIU(
+ "wascana.mingw.tdm.gcc4.core",
+ gcc4version,
+ "Wascana MinGW TDM gcc-4 core",
+ "http://downloads.sourceforge.net/tdm-gcc/gcc-4.3.3-tdm-1-core.tar.gz",
mingwSubdir,
- GZ_COMPRESSION);
+ GZ_COMPRESSION,
+ new IRequiredCapability[] {
+ createRequiredCap(runtimeDLLIU),
+ createRequiredCap(runtimeLibIU),
+ createRequiredCap(w32apiIU),
+ createRequiredCap(binutilsIU)
+ },
+ gplLic,
+ false);
// gcc-4 g++
- String gcc4gppId = "wascana.mingw.gcc4.g++";
- InstallableUnitDescription gcc4gppIUDesc = createIUDesc(gcc4gppId, gcc4Version, "Wascana MinGW gcc-4 g++", gplLic);
- gcc4gppIUDesc.setLicense(gplLic);
- IRequiredCapability[] gcc4gppReqs = new IRequiredCapability[] {
- MetadataFactory.createRequiredCapability(
- IInstallableUnit.NAMESPACE_IU_ID,
- gcc4coreIU.getId(), new VersionRange(gcc4Version, true, gcc4Version, true), null, false, false),
- };
- gcc4gppIUDesc.setRequiredCapabilities(gcc4gppReqs);
- IInstallableUnit gcc4gppIU = createIU(gcc4gppIUDesc, gcc4gppId, gcc4Version,
- "http://downloads.sourceforge.net/tdm-gcc/gcc-4.3.2-tdm-1-g++.tar.gz",
+ IInstallableUnit gcc4gppIU = createIU(
+ "wascana.mingw.tdm.gcc4.g++",
+ gcc4version,
+ "Wascana MinGW TDM gcc-4 g++",
+ "http://downloads.sourceforge.net/tdm-gcc/gcc-4.3.3-tdm-1-g++.tar.gz",
mingwSubdir,
- GZ_COMPRESSION);
+ GZ_COMPRESSION,
+ new IRequiredCapability[] {
+ createStrictRequiredCap(gcc4coreIU)
+ },
+ gplLic,
+ false);
// gdb
- String gdbId = "wascana.mingw.gdb";
- Version gdbVersion = new Version("6.8.0.4");
- InstallableUnitDescription gdbIUDesc = createIUDesc(gdbId, gdbVersion, "Wascana MinGW gdb", gplLic);
- IInstallableUnit gdbIU = createIU(gdbIUDesc, gdbId, gdbVersion,
+ IInstallableUnit gdbIU = createIU(
+ "wascana.mingw.gdb",
+ new Version("6.8.0.3"),
+ "Wascana MinGW gdb",
"http://downloads.sourceforge.net/mingw/gdb-6.8-mingw-3.tar.bz2",
mingwSubdir,
- BZ2_COMPRESSION);
+ BZ2_COMPRESSION,
+ null,
+ gplLic,
+ false);
+
+ InstallableUnitDescription toolchainIUDesc = createIUDesc(
+ "wascana.toolchain",
+ new Version("4.3.3"),
+ "Wascana Toolchain (gcc, g++, gdb)",
+ null);
+ toolchainIUDesc.setProperty(IInstallableUnit.PROP_TYPE_GROUP, Boolean.TRUE.toString());
+ toolchainIUDesc.setRequiredCapabilities(new IRequiredCapability[] {
+ createRequiredCap(runtimeDLLIU),
+ createRequiredCap(runtimeLibIU),
+ createRequiredCap(w32apiIU),
+ createRequiredCap(binutilsIU),
+ createRequiredCap(gcc4coreIU),
+ createRequiredCap(gcc4gppIU),
+ createRequiredCap(gdbIU),
+ });
+ IInstallableUnit toolchainIU = MetadataFactory.createInstallableUnit(toolchainIUDesc);
// msys
- String msysId = "wascana.msys.core";
- Version msysVersion = new Version("1.0.11.20080826");
- InstallableUnitDescription msysIUDesc = createIUDesc(msysId, msysVersion, "Wascana MSYS Build System", gplLic);
- IInstallableUnit msysIU = createIU(msysIUDesc, msysId, msysVersion,
+ IInstallableUnit msysIU = createIU(
+ "wascana.msys.core",
+ new Version("1.0.11.20080826"),
+ "Wascana MSYS Shell",
"http://downloads.sourceforge.net/mingw/msysCORE-1.0.11-20080826.tar.gz",
"msys",
- GZ_COMPRESSION);
-
- // MinGW toolchain category
- InstallableUnitDescription mingwToolchainDesc = createIUDesc("wascana.mingw", wascanaVersion, "MinGW Toolchain", null);;
- mingwToolchainDesc.setProperty(IInstallableUnit.PROP_TYPE_CATEGORY, Boolean.TRUE.toString());
- IRequiredCapability[] mingwToolchainReqs = new IRequiredCapability[] {
- createRequiredCap(runtimeId),
- createRequiredCap(w32apiId),
- createRequiredCap(binutilsId),
- createRequiredCap(gcc4coreId),
- createRequiredCap(gcc4gppId),
- createRequiredCap(gdbId),
- createRequiredCap(msysId),
- };
- mingwToolchainDesc.setRequiredCapabilities(mingwToolchainReqs);
- IInstallableUnit mingwToolchainIU = MetadataFactory.createInstallableUnit(mingwToolchainDesc);
+ GZ_COMPRESSION,
+ null,
+ gplLic,
+ true);
// zlib
- String zlibId = "wascana.zlib";
- Version zlibVersion = new Version("1.2.3");
- InstallableUnitDescription zlibIUDesc = createIUDesc(zlibId, zlibVersion, "Wascana zlib Library", zlibLic);
- IInstallableUnit zlibIU = createIU(zlibIUDesc, zlibId, zlibVersion,
+ IInstallableUnit zlibIU = createIU(
+ "wascana.zlib",
+ new Version("1.2.3"),
+ "Wascana zlib Library",
"http://downloads.sourceforge.net/wascana/zlib-mingw-1.2.3.zip",
mingwSubdir,
- ZIP_COMPRESSION);
+ ZIP_COMPRESSION,
+ null,
+ zlibLic,
+ true);
// SDL
- String sdlId = "wascana.sdl";
- Version sdlVersion = new Version("1.2.13");
- InstallableUnitDescription sdlIUDesc = createIUDesc(sdlId, sdlVersion, "Wascana SDL (Simple Directmedia Layer) Library", lgplLic);
- IInstallableUnit sdlIU = createIU(sdlIUDesc, sdlId, sdlVersion,
+ IInstallableUnit sdlIU = createIU(
+ "wascana.sdl",
+ new Version("1.2.13"),
+ "Wascana SDL (Simple Directmedia Layer) Library",
"http://downloads.sourceforge.net/wascana/SDL-mingw-1.2.13.zip",
mingwSubdir,
- ZIP_COMPRESSION);
+ ZIP_COMPRESSION,
+ null,
+ lgplLic,
+ true);
// wxWidgets
- String wxId = "wascana.wxWidgets";
- Version wxVersion = new Version("2.8.9");
- InstallableUnitDescription wxDesc = createIUDesc(wxId, wxVersion, "Wascana wxWidgets Library", wxLic);
- IInstallableUnit wxIU = createIU(wxDesc, wxId, wxVersion,
+ IInstallableUnit wxIU = createIU(
+ "wascana.wxWidgets",
+ new Version("2.8.9"),
+ "Wascana wxWidgets Library",
"http://downloads.sourceforge.net/wascana/wxMSW-mingw-2.8.9.zip",
mingwSubdir,
- ZIP_COMPRESSION);
+ ZIP_COMPRESSION,
+ null,
+ wxLic,
+ true);
// Libraries toolchain category
- InstallableUnitDescription libsIUDesc = createIUDesc("wascana.libs", wascanaVersion, "Libraries", null);;
- libsIUDesc.setProperty(IInstallableUnit.PROP_TYPE_CATEGORY, Boolean.TRUE.toString());
- IRequiredCapability[] libsReqs = new IRequiredCapability[] {
- createRequiredCap(zlibId),
- createRequiredCap(sdlId),
- createRequiredCap(wxId),
- };
- libsIUDesc.setRequiredCapabilities(libsReqs);
- IInstallableUnit libsIU = MetadataFactory.createInstallableUnit(libsIUDesc);
+ InstallableUnitDescription wascanaIUDesc = createIUDesc("wascana", wascanaVersion, "Wascana Desktop Developer", null);;
+ wascanaIUDesc.setProperty(IInstallableUnit.PROP_TYPE_CATEGORY, Boolean.TRUE.toString());
+ wascanaIUDesc.setRequiredCapabilities(new IRequiredCapability[] {
+ createRequiredCap(toolchainIU),
+ createRequiredCap(msysIU),
+ createRequiredCap(zlibIU),
+ createRequiredCap(sdlIU),
+ createRequiredCap(wxIU),
+ });
+ IInstallableUnit wascanaIU = MetadataFactory.createInstallableUnit(wascanaIUDesc);
metaRepo.addInstallableUnits(new IInstallableUnit[] {
- runtimeIU,
+ runtimeDLLIU,
+ runtimeLibIU,
w32apiIU,
binutilsIU,
gcc4coreIU,
gcc4gppIU,
gdbIU,
msysIU,
- mingwToolchainIU,
wxIU,
zlibIU,
sdlIU,
- libsIU
+
+ toolchainIU,
+ wascanaIU
});
System.out.println("done");
@@ -257,8 +304,13 @@ public class MinGWGenerator implements IApplication {
return iuDesc;
}
- private IInstallableUnit createIU(InstallableUnitDescription iuDesc, String id, Version version, String location, String subdir, String compression) throws ProvisionException {
- iuDesc.setProperty(IInstallableUnit.PROP_TYPE_GROUP, Boolean.TRUE.toString());
+ private IInstallableUnit createIU(String id, Version version, String name, String location, String subdir, String compression,
+ IRequiredCapability[] reqs, ILicense license, boolean group) throws ProvisionException {
+ InstallableUnitDescription iuDesc = createIUDesc(id, version, name, license);
+ if (reqs != null)
+ iuDesc.setRequiredCapabilities(reqs);
+
+ iuDesc.setProperty(IInstallableUnit.PROP_TYPE_GROUP, String.valueOf(group));
iuDesc.setTouchpointType(NATIVE_TOUCHPOINT);
Map<String, String> tpdata = new HashMap<String, String>();
@@ -282,11 +334,18 @@ public class MinGWGenerator implements IApplication {
return MetadataFactory.createInstallableUnit(iuDesc);
}
- private IRequiredCapability createRequiredCap(String id) {
+ private IRequiredCapability createRequiredCap(IInstallableUnit iu) {
+ return MetadataFactory.createRequiredCapability(
+ IInstallableUnit.NAMESPACE_IU_ID,
+ iu.getId(), new VersionRange(null), null, false, false);
+ }
+
+ private IRequiredCapability createStrictRequiredCap(IInstallableUnit iu) {
return MetadataFactory.createRequiredCapability(
IInstallableUnit.NAMESPACE_IU_ID,
- id, new VersionRange(null), null, false, false);
+ iu.getId(), new VersionRange(iu.getVersion(), true, iu.getVersion(), true), null, false, false);
}
+ // TODO make these more legal...
public static final String publicDomain = "This package is placed in the Public Domain."
+ " No warranty is given; refer to the header files within the package.";

Back to the top