diff options
author | Pascal Rapicault | 2008-05-14 21:51:39 +0000 |
---|---|---|
committer | Pascal Rapicault | 2008-05-14 21:51:39 +0000 |
commit | 44f3f7e0bbbfe1a81d394770d863ccddfb34df5b (patch) | |
tree | c3fe4c67dc77f508b86733289f50d1ededfd8f03 | |
parent | 619e79cd6d330dfb863e3430b2d60dc50f7bbc54 (diff) | |
download | rt.equinox.p2-44f3f7e0bbbfe1a81d394770d863ccddfb34df5b.tar.gz rt.equinox.p2-44f3f7e0bbbfe1a81d394770d863ccddfb34df5b.tar.xz rt.equinox.p2-44f3f7e0bbbfe1a81d394770d863ccddfb34df5b.zip |
Bug 228406 - Generator app fails if artifact repository not specified
3 files changed, 18 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java index bb632d262..62e545be1 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java +++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java @@ -157,11 +157,13 @@ public class EclipseGeneratorApplication implements IApplication { } private void initializeMetadataRepository(EclipseInstallGeneratorInfoProvider provider) throws ProvisionException { + if (metadataLocation == null) + return; URL location; try { location = new URL(metadataLocation); } catch (MalformedURLException e) { - throw new IllegalArgumentException(NLS.bind(Messages.exception_metadataRepoLocationURL, artifactLocation)); + throw new IllegalArgumentException(NLS.bind(Messages.exception_metadataRepoLocationURL, metadataLocation)); } // First try to create a simple repo, this will fail if one already exists @@ -343,6 +345,17 @@ public class EclipseGeneratorApplication implements IApplication { System.out.println(Messages.exception_baseLocationNotSpecified); return new Integer(-1); } + + if (provider.getArtifactRepository() == null) { + System.out.println(Messages.exception_artifactRepoNotSpecified); + return new Integer(-1); + } + + if (provider.getMetadataRepository() == null) { + System.out.println(Messages.exception_metadataRepoNotSpecified); + return new Integer(-1); + } + System.out.println(NLS.bind(Messages.message_generatingMetadata, provider.getBaseLocation())); long before = System.currentTimeMillis(); diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/Messages.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/Messages.java index c28acd1e5..444fe0706 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/Messages.java +++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/Messages.java @@ -20,8 +20,10 @@ public class Messages extends NLS { public static String exception_sourceDirectoryInvalid; public static String exception_artifactRepoLocationURL; public static String exception_artifactRepoNotWritable; + public static String exception_artifactRepoNotSpecified; public static String exception_metadataRepoLocationURL; public static String exception_metadataRepoNotWritable; + public static String exception_metadataRepoNotSpecified; public static String exception_baseLocationNotSpecified; public static String message_generatingMetadata; diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/messages.properties b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/messages.properties index 08affcbdc..55a021e96 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/messages.properties +++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/messages.properties @@ -15,8 +15,10 @@ exception_stateAddition = An error has occurred while adding the bundle {0}. exception_sourceDirectoryInvalid = Source directory is invalid: {0}. exception_artifactRepoLocationURL = Artifact repository location is not a valid URL: {0}. exception_artifactRepoNotWritable = Artifact repository is not writable: {0}. +exception_artifactRepoNotSpecified = An artifact repository was not specified. exception_metadataRepoLocationURL = Metadata repository location is not a valid URL: {0}. exception_metadataRepoNotWritable = Metadata repository not writable: {0}. +exception_metadataRepoNotSpecified = A metadata repository location was not specified. exception_baseLocationNotSpecified = Eclipse base location not specified. message_generatingMetadata = Generating metadata for {0}. |