diff options
author | Tor Norbye <tnorbye@google.com> | 2012-12-04 16:44:35 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-12-04 16:51:03 -0800 |
commit | 06e2c101a2ebd1810ead3c873efbd39628b6de2d (patch) | |
tree | 73da2f2c5c9b3cf72bf73ccc6a8628a2d5213b3e /eclipse/plugins | |
parent | 154ef78e9c8fc661149909e1b13186da114245dd (diff) | |
download | sdk-06e2c101a2ebd1810ead3c873efbd39628b6de2d.zip sdk-06e2c101a2ebd1810ead3c873efbd39628b6de2d.tar.gz sdk-06e2c101a2ebd1810ead3c873efbd39628b6de2d.tar.bz2 |
Make templates handle custom namespaces properly
Change-Id: Id3685aa63a1e3017b345ec28bbb454656547258c
Diffstat (limited to 'eclipse/plugins')
2 files changed, 7 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java index 2f9d939..fdb26b1 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java @@ -61,6 +61,7 @@ public class NewProjectWizard extends TemplateWizard { private static final String ACTIVITY_TITLE = "activityTitle"; //$NON-NLS-1$ private static final String IS_LAUNCHER = "isLauncher"; //$NON-NLS-1$ static final String IS_NEW_PROJECT = "isNewProject"; //$NON-NLS-1$ + static final String IS_LIBRARY_PROJECT = "isLibraryProject"; //$NON-NLS-1$ static final String ATTR_COPY_ICONS = "copyIcons"; //$NON-NLS-1$ static final String ATTR_TARGET_API = "targetApi"; //$NON-NLS-1$ static final String ATTR_MIN_API = "minApi"; //$NON-NLS-1$ @@ -385,6 +386,7 @@ public class NewProjectWizard extends TemplateWizard { addProjectInfo(parameters); parameters.put(IS_NEW_PROJECT, true); + parameters.put(IS_LIBRARY_PROJECT, mValues.isLibrary); // Ensure that activities created as part of a new project are marked as // launcher activities parameters.put(IS_LAUNCHER, true); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplateWizardState.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplateWizardState.java index 1d1eb1d..805399b 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplateWizardState.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplateWizardState.java @@ -22,6 +22,7 @@ import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectW import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_MIN_API_LEVEL; import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_PACKAGE_NAME; import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_TARGET_API; +import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.IS_LIBRARY_PROJECT; import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.IS_NEW_PROJECT; import static com.android.ide.eclipse.adt.internal.wizards.templates.NewTemplateWizard.BLANK_ACTIVITY; @@ -30,6 +31,7 @@ import com.android.annotations.Nullable; import com.android.ide.eclipse.adt.internal.assetstudio.ConfigureAssetSetPage; import com.android.ide.eclipse.adt.internal.assetstudio.CreateAssetSetWizardState; import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo; +import com.android.ide.eclipse.adt.internal.sdk.ProjectState; import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.sdklib.IAndroidTarget; @@ -155,6 +157,9 @@ public class NewTemplateWizardState { parameters.put(ATTR_TARGET_API, manifest.getTargetSdkVersion()); parameters.put(ATTR_BUILD_API, getBuildApi()); parameters.put(ATTR_COPY_ICONS, mIconState == null); + ProjectState projectState = Sdk.getProjectState(project); + parameters.put(IS_LIBRARY_PROJECT, + projectState != null ? projectState.isLibrary() : false); List<Change> changes = getTemplateHandler().render(project, parameters); |