diff options
author | Siva Velusamy <vsiva@google.com> | 2012-09-17 14:50:49 -0700 |
---|---|---|
committer | Siva Velusamy <vsiva@google.com> | 2012-09-18 17:42:52 -0700 |
commit | 0b0513a87849429763e5fb5934598393daf7e6d1 (patch) | |
tree | f077bcebaa43284870799aa4c96135ff4ccf54d7 /eclipse/plugins | |
parent | 0f86143e55290c4851e51b9a46ff21e198a35acc (diff) | |
download | sdk-0b0513a87849429763e5fb5934598393daf7e6d1.zip sdk-0b0513a87849429763e5fb5934598393daf7e6d1.tar.gz sdk-0b0513a87849429763e5fb5934598393daf7e6d1.tar.bz2 |
Add Android IDE package product build
Change-Id: I42426009df581ff51389f0641eab053ac706d723
Diffstat (limited to 'eclipse/plugins')
12 files changed, 250 insertions, 16 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/.project b/eclipse/plugins/com.android.ide.eclipse.adt.package/.project new file mode 100644 index 0000000..eedf4c6 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/.project @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>plugin-adt-package</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + </natures> +</projectDescription> diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.adt.package/META-INF/MANIFEST.MF new file mode 100644 index 0000000..752f749 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: ADT Package +Bundle-SymbolicName: com.android.ide.eclipse.adt.package;singleton:=true +Bundle-Version: 20.0.0.qualifier +Bundle-Vendor: The Android Open Source Project +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: org.eclipse.platform, + org.eclipse.equinox.app, + org.eclipse.ui.intro diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/build.properties b/eclipse/plugins/com.android.ide.eclipse.adt.package/build.properties new file mode 100644 index 0000000..1e6342e --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/build.properties @@ -0,0 +1,8 @@ +bin.includes = META-INF/,\ + plugin.xml,\ + plugin_customization.ini,\ + ide.product,\ + splash.bmp,\ + introcontent.xml,\ + go.css,\ + index.html diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/go.css b/eclipse/plugins/com.android.ide.eclipse.adt.package/go.css new file mode 100644 index 0000000..15ba70b --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/go.css @@ -0,0 +1,2 @@ +/* Copy of www.google.com/css/go.css */ +@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext);@media screen,projection,print{html,input,textarea{font-family:arial,sans-serif}html{line-height:1.54}body.rtl{direction:rtl}body.rtl th{text-align:right}h5,h6,pre,table,input,textarea,code{font-size:1em}address,abbr,cite{font-style:normal}table{border-collapse:collapse;border-spacing:0}th{text-align:left}fieldset,iframe,img{border:0}label input,#nav li a{font-weight:normal}label{display:block;margin:13px 0 3px}q{quotes:none}}@media screen,projection{* html{direction:ltr}*+html{direction:ltr}*+html body.rtl{max-width:none}html{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABECAMAAAB3Xq9kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+ID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BE7N+9ZgAAAABJRU5ErkJggg==) repeat-x;color:#444;font-size:13px;padding-top:5px}body,table,fieldset,#nav{margin:0}body{max-width:1000px;padding:15px}body.rtl h1 img,body.rtl #nav{float:right}body.rtl h1 img{margin:0 0 0 43px}body.rtl #nav ul,body.rtl #nav ol{margin:13px 13px 0 0}* html body.rtl #about li{margin:0 0 0 13px}*+html body.rtl #about li{margin:0 0 0 13px}body.rtl #aux{margin:0 160px 0 0}body.compact{margin:auto;width:740px}*>body.compact{max-width:740px;width:auto}h1,h2,h3,h4,h5,blockquote,q{font-family:'open sans',arial,sans-serif}h1{color:#91959c;font-size:27px;font-weight:300;height:51px;line-height:1.26;margin:0 0 25px;overflow:hidden}h1 img,#nav{float:left}h1 img{margin:0 43px 0 0;position:relative}h1 img[src$='logo_sm.gif']{width:116px}h2,h3,h4,h5{margin:20px 0 10px}h2{font-size:21px}h2:first-child,p+table,table+p{margin-top:0}h3{font-size:16px;line-height:1.56}h4{font-size:14px;line-height:1.57}h6{margin:10px 0 -10px}p,pre,table,form{margin:10px 0}blockquote,ul,ol{margin-bottom:10px;margin-top:10px}blockquote,q{font-style:italic}pre strong,pre b,a strong,a b,a code{color:inherit}pre,code{color:#060;font:13px/1.54 'courier new',courier,monospace}th,td{padding-right:10px;vertical-align:top}fieldset,#about,#nav,#nav ul,#nav ol{padding:0}legend{display:none}label,em,i,#nav li{font-weight:bold}a:link,a:visited{text-decoration:none}a:link{color:#15c}a:visited{color:#7847b2}a:focus,a:hover,a:active{text-decoration:underline}strong,b{color:#000}em,i{font-style:normal}#about,#nav,#nav *{list-style:none}#about{clear:both;font-size:11px;color:#666;line-height:1.8;margin:26px 0 0}#about li{display:inline}#about li:before{content:' · '}#about li:first-child:before{content:none}* html #about li{margin:0 13px 0 0}*+html #about li{margin:0 13px 0 0}#nav{width:142px}#nav ul,#nav ol{margin:10px 0 0 13px}#nav li{margin:0 0 10px}#aux{margin:0 0 0 160px}}@media screen and (max-width:772px){html{background-image:none}body.rtl #nav li{margin-left:10px;margin-right:0}h1,#aux{margin:0 !important}h1{height:auto}h1 img,#nav{float:none !important}h1 img{display:block}#nav{margin-bottom:13px;width:auto !important}#nav ul,#nav ol{display:none}#nav li{display:inline;margin-right:10px}}@media print{h1 img{display:block}a{color:inherit}#nav{display:none}} diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/ide.product b/eclipse/plugins/com.android.ide.eclipse.adt.package/ide.product new file mode 100644 index 0000000..645beaf --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/ide.product @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?pde version="3.5"?> + +<product name="Eclipse IDE for Android" uid="com.android.ide.eclipse.adt.package.product" id="com.android.ide.eclipse.adt.package.product" application="org.eclipse.ui.ide.workbench" version="20.0.0.qualifier" useFeatures="true" includeLaunchers="true"> + + + <configIni use="default"> + </configIni> + + <launcherArgs> + <programArgs>-product com.android.ide.eclipse.adt.package.product</programArgs> + <programArgsWin>--launcher.XXMaxPermSize 256M</programArgsWin> + <vmArgs>-Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx512m</vmArgs> + <vmArgsLin>-XX:MaxPermSize=256m</vmArgsLin> + <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac> + </launcherArgs> + + <windowImages/> + + <splash + location="com.android.ide.eclipse.adt.package" /> + <launcher> + <solaris/> + <win useIco="false"> + <bmp/> + </win> + </launcher> + + + <vm> + <linux include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</linux> + <macos include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</macos> + <windows include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</windows> + </vm> + + + <plugins> + </plugins> + + <features> + <feature id="com.android.ide.eclipse.adt.package" version="20.0.0.qualifier"/> + </features> + + <configurations> + <property name="eclipse.product" value="com.android.ide.eclipse.adt.package.product" /> + </configurations> + +</product> diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/index.html b/eclipse/plugins/com.android.ide.eclipse.adt.package/index.html new file mode 100644 index 0000000..ba9a748 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/index.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> + <html lang="en"> + <meta charset="utf-8"> + <title>Eclipse for Android Developers</title> + <link rel="stylesheet" href="go.css"> + + <body class="compact"> + <h1>Eclipse for Android Developers</h1> + + <h2>Getting Started</h2> + <h2>What's New?</h2> + <h2>Documentation</h2> + <ul> + <li> <a href="http://d.android.com/">Android Developers</a> + </ul> + <h2>Known Issues</h2> + + <ul id="about"> + <li>© Android Open Source Project + <li>2012 + </ul> diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/introcontent.xml b/eclipse/plugins/com.android.ide.eclipse.adt.package/introcontent.xml new file mode 100644 index 0000000..65d226f --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/introcontent.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" ?> +<introContent> + <page + id="root" + url="index.html"/> + <page + id="standbyPageId" + url="index.html"/> +</introContent>
\ No newline at end of file diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin.xml new file mode 100644 index 0000000..3359ee0 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + id="product" + point="org.eclipse.core.runtime.products"> + <product + application="org.eclipse.ui.ide.workbench" + name="Eclipse IDE for Android"> + <property + name="preferenceCustomization" + value="plugin_customization.ini" /> + <property + name="appName" + value="Eclipse IDE for Android" /> + <property + name="introTitle" + value="Eclipse IDE for Android" /> + <property + name="introBrandingImage" + value="product:eclipse.png" /> + <property + name="introBrandingImageText" + value="AOSP" /> + <property + name="startupProgressRect" + value="10,250,200,5" /> + <property + name="startupMessageRect" + value="10,260,300,30" /> + <property + name="startupForegroundColor" + value="AAAAAA" /> + </product> + </extension> + <extension + point="org.eclipse.ui.intro"> + <intro + class="org.eclipse.ui.intro.config.CustomizableIntroPart" + icon="$nl$/icons/image_obj.gif" + id="org.eclipse.intro.minimal" + label="Android IDE"/> + </extension> + <extension + point="org.eclipse.ui.intro.config"> + <config + content="introcontent.xml" + id="org.eclipse.intro.minimal.config" + introId="org.eclipse.intro.minimal"> + <presentation + home-page-id="root" + standby-page-id="standby"> + <implementation + kind="html"> + </implementation> + </presentation> + </config> + </extension> + <extension + point="org.eclipse.ui.intro"> + <introProductBinding + introId="org.eclipse.intro.minimal" + productId="com.android.ide.eclipse.adt.package.product"> + </introProductBinding> + </extension> +</plugin> diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin_customization.ini b/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin_customization.ini new file mode 100644 index 0000000..50c3948 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin_customization.ini @@ -0,0 +1,7 @@ +org.eclipse.ui/defaultPerspectiveId=org.eclipse.jdt.ui.JavaPerspective +org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false +org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight +org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true +org.eclipse.ui.intro/INTRO_THEME = org.eclipse.ui.intro.universal.slate +org.eclipse.ui.intro.universal/INTRO_ROOT_PAGES=overview,tutorials,samples,whatsnew,migrate,webresources +org.eclipse.ui.intro.universal/INTRO_DATA = product:introData.xml
\ No newline at end of file diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/splash.bmp b/eclipse/plugins/com.android.ide.eclipse.adt.package/splash.bmp Binary files differnew file mode 100644 index 0000000..80dd82e --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/splash.bmp diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java index 5e69e6f..8d8b688 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java @@ -31,10 +31,12 @@ import com.android.sdkstats.SdkStatsService; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.osgi.service.datalocation.Location; import org.eclipse.ui.IStartup; import org.eclipse.ui.IWindowListener; import org.eclipse.ui.IWorkbench; @@ -69,6 +71,10 @@ public class AdtStartup implements IStartup, IWindowListener { @Override public void earlyStartup() { + if (InstallDetails.isAndroidIdePackage()) { + useBundledSdk(); + } + if (isFirstTime()) { showWelcomeWizard(); // Usage statistics are sent after the wizard has run asynchronously (provided the @@ -82,6 +88,32 @@ public class AdtStartup implements IStartup, IWindowListener { AdtPlugin.getDefault().workbenchStarted(); } + private void useBundledSdk() { + String osSdkFolder = AdtPrefs.getPrefs().getOsSdkFolder(); + + // sdk path is already set + if (osSdkFolder != null && osSdkFolder.length() > 0) { + return; + } + + // The Android IDE bundle is structured as follows: + // root + // |--eclipse + // |--sdk + // So use the SDK folder that is + Location install = Platform.getInstallLocation(); + if (install != null && install.getURL() != null) { + String toolsFolder = new File(install.getURL().getFile()).getParent(); + if (toolsFolder != null) { + String osSdkPath = toolsFolder + File.separator + "sdk"; + if (AdtPlugin.getDefault().checkSdkLocationAndId(osSdkPath, + new SdkValidator())) { + AdtPrefs.getPrefs().setSdkLocation(new File(osSdkPath)); + } + } + } + } + private boolean isFirstTime() { // If we already have a known SDK location in our workspace then we know this // is not the first time this user is running ADT. @@ -112,22 +144,8 @@ public class AdtStartup implements IStartup, IWindowListener { if (ok) { // Verify that the SDK is valid - ok = AdtPlugin.getDefault().checkSdkLocationAndId(osSdkPath, - new AdtPlugin.CheckSdkErrorHandler() { - @Override - public boolean handleError( - CheckSdkErrorHandler.Solution solution, - String message) { - return false; - } - - @Override - public boolean handleWarning( - CheckSdkErrorHandler.Solution solution, - String message) { - return true; - } - }); + ok = AdtPlugin.getDefault().checkSdkLocationAndId( + osSdkPath, new SdkValidator()); if (ok) { // Yes, we've seen an SDK location before and we can use it again, // no need to pester the user with the welcome wizard. @@ -144,6 +162,22 @@ public class AdtStartup implements IStartup, IWindowListener { return !mStore.isAdtUsed(); } + private static class SdkValidator extends AdtPlugin.CheckSdkErrorHandler { + @Override + public boolean handleError( + CheckSdkErrorHandler.Solution solution, + String message) { + return false; + } + + @Override + public boolean handleWarning( + CheckSdkErrorHandler.Solution solution, + String message) { + return true; + } + } + private String getSdkPathFromWindowsRegistry() { if (SdkConstants.CURRENT_PLATFORM != SdkConstants.PLATFORM_WINDOWS) { return null; diff --git a/eclipse/plugins/com.android.ide.eclipse.base/src/com/android/ide/eclipse/base/InstallDetails.java b/eclipse/plugins/com.android.ide.eclipse.base/src/com/android/ide/eclipse/base/InstallDetails.java index 8c4a4a7..71eccbf 100644 --- a/eclipse/plugins/com.android.ide.eclipse.base/src/com/android/ide/eclipse/base/InstallDetails.java +++ b/eclipse/plugins/com.android.ide.eclipse.base/src/com/android/ide/eclipse/base/InstallDetails.java @@ -23,6 +23,7 @@ import org.osgi.framework.Version; public class InstallDetails { private static final String ADT_PLUGIN_ID = "com.android.ide.eclipse.adt"; //$NON-NLS-1$ private static final String ECLIPSE_PLATFORM_PLUGIN_ID = "org.eclipse.platform"; //$NON-NLS-1$ + private static final String ADT_PRODUCT_PLUGIN_ID = "com.android.ide.eclipse.adt.package"; //$NON-NLS-1$ /** * Returns true if the ADT plugin is available in the current platform. This is useful @@ -38,4 +39,10 @@ public class InstallDetails { Bundle b = Platform.getBundle(ECLIPSE_PLATFORM_PLUGIN_ID); return b == null ? Version.emptyVersion : b.getVersion(); } + + /** Returns true if this is the "Eclipse for Android Developers" product. */ + public static boolean isAndroidIdePackage() { + Bundle b = Platform.getBundle(ADT_PRODUCT_PLUGIN_ID); + return b != null; + } } |