Skip to content

Commit

Permalink
IDE-348 get deploy, undeploy, and update working for remote servers
Browse files Browse the repository at this point in the history
  • Loading branch information
gamerson committed Jul 12, 2011
1 parent ad2d072 commit 2978aca
Show file tree
Hide file tree
Showing 13 changed files with 1,523 additions and 1,360 deletions.
@@ -1,38 +1,40 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay Plugin SDK
Bundle-SymbolicName: com.liferay.ide.eclipse.sdk;singleton:=true
Bundle-Version: 1.3.0.qualifier
Bundle-Activator: com.liferay.ide.eclipse.sdk.SDKPlugin
Bundle-Vendor: Liferay, Inc.
Require-Bundle: org.eclipse.ui,
org.eclipse.jdt.launching,
org.eclipse.debug.core,
org.eclipse.ant.core,
org.eclipse.ant.ui,
com.liferay.ide.eclipse.core,
org.eclipse.ui.externaltools,
org.eclipse.debug.ui,
org.eclipse.jdt.debug.ui,
org.eclipse.jdt.core,
org.eclipse.wst.server.core;bundle-version="[1.1.102,2.0.0)",
org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.1,1.5.0)",
com.liferay.ide.eclipse.ui,
org.eclipse.ant.launching
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.liferay.ide.eclipse.sdk,
com.liferay.ide.eclipse.sdk.job,
com.liferay.ide.eclipse.sdk.pref,
com.liferay.ide.eclipse.sdk.util,
org.apache.commons.configuration,
org.apache.commons.configuration.beanutils,
org.apache.commons.configuration.event,
org.apache.commons.configuration.interpol,
org.apache.commons.configuration.plist,
org.apache.commons.configuration.reloading,
org.apache.commons.configuration.tree,
org.apache.commons.configuration.tree.xpath,
org.apache.commons.configuration.web
Bundle-ClassPath: .,
lib/commons-configuration-1.6.jar
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay Plugin SDK
Bundle-SymbolicName: com.liferay.ide.eclipse.sdk;singleton:=true
Bundle-Version: 1.3.0.qualifier
Bundle-Activator: com.liferay.ide.eclipse.sdk.SDKPlugin
Bundle-Vendor: Liferay, Inc.
Require-Bundle: org.eclipse.ui,
org.eclipse.jdt.launching,
org.eclipse.debug.core,
org.eclipse.ant.core,
org.eclipse.ant.ui,
com.liferay.ide.eclipse.core,
org.eclipse.ui.externaltools,
org.eclipse.debug.ui,
org.eclipse.jdt.debug.ui,
org.eclipse.jdt.core,
org.eclipse.wst.server.core;bundle-version="[1.1.102,2.0.0)",
org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.1,1.5.0)",
com.liferay.ide.eclipse.ui,
org.eclipse.ant.launching,
org.apache.commons.logging;visibility:=reexport,
org.apache.commons.collections;visibility:=reexport
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.liferay.ide.eclipse.sdk,
com.liferay.ide.eclipse.sdk.job,
com.liferay.ide.eclipse.sdk.pref,
com.liferay.ide.eclipse.sdk.util,
org.apache.commons.configuration,
org.apache.commons.configuration.beanutils,
org.apache.commons.configuration.event,
org.apache.commons.configuration.interpol,
org.apache.commons.configuration.plist,
org.apache.commons.configuration.reloading,
org.apache.commons.configuration.tree,
org.apache.commons.configuration.tree.xpath,
org.apache.commons.configuration.web
Bundle-ClassPath: .,
lib/commons-configuration-1.6.jar
Expand Up @@ -24,6 +24,7 @@
*/
public interface ISDKConstants {

@SuppressWarnings( "deprecation" )
public static final IEclipsePreferences _defaultPrefs = new DefaultScope().getNode(SDKPlugin.PLUGIN_ID);

public static final String[] ANT_LIBRARIES = _defaultPrefs.get("ant.libraries", "").split(",");
Expand Down Expand Up @@ -62,7 +63,7 @@ public interface ISDKConstants {

public static final String PORTLET_PLUGIN_ZIP_PATH = _defaultPrefs.get("portlet.plugin.zip.path", null);

static final String PROJECT_BUILD_XML = _defaultPrefs.get("project.build.xml", null);
public static final String PROJECT_BUILD_XML = _defaultPrefs.get( "project.build.xml", null );

public static final String PROPERTY_APP_SERVER_DEPLOY_DIR = "app.server.deploy.dir";

Expand Down Expand Up @@ -144,6 +145,8 @@ public interface ISDKConstants {

public static final String TARGET_DIRECT_DEPLOY = "direct-deploy";

public static final String TARGET_WAR = "war";

public static final String THEME_PLUGIN_ANT_BUILD = _defaultPrefs.get("theme.plugin.ant.build", null);

public static final String THEME_PLUGIN_PROJECT_FOLDER = "themes";
Expand Down
Expand Up @@ -412,6 +412,7 @@ public IPath createNewThemeProject(String themeName, String themeDisplayName) {
public IStatus directDeploy(
IProject project, Map<String, String> overrideProperties, boolean separateJRE,
Map<String, String> appServerProperties ) {

try {
SDKHelper antHelper = new SDKHelper(this);

Expand Down Expand Up @@ -566,6 +567,32 @@ public IStatus validate() {
return Status.OK_STATUS;
}

public IStatus war(
IProject project, Map<String, String> overrideProperties, boolean separateJRE,
Map<String, String> appServerProperties ) {

try {
SDKHelper antHelper = new SDKHelper( this );

persistAppServerProperties( appServerProperties );

Map<String, String> properties = new HashMap<String, String>();

if ( overrideProperties != null ) {
properties.putAll( overrideProperties );
}

antHelper.runTarget(
project.getFile( ISDKConstants.PROJECT_BUILD_XML ).getRawLocation(), ISDKConstants.TARGET_WAR,
properties, separateJRE );
}
catch ( Exception e ) {
return SDKPlugin.createErrorStatus( e );
}

return Status.OK_STATUS;
}

private boolean promptForOverwrite(final File userBuildFile) {
final boolean[] retval = new boolean[1];

Expand Down
@@ -1,43 +1,41 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay Server Core
Bundle-SymbolicName: com.liferay.ide.eclipse.server.core;singleton:=true
Bundle-Version: 1.3.0.qualifier
Bundle-Activator: com.liferay.ide.eclipse.server.core.LiferayServerCorePlugin
Bundle-Vendor: Liferay, Inc.
Require-Bundle: org.eclipse.ui,
org.eclipse.wst.server.core;bundle-version="[1.1.102,2.0.0)";visibility:=reexport,
org.eclipse.jst.server.core;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.debug.core,
org.eclipse.jdt.launching,
com.liferay.ide.eclipse.core,
org.eclipse.jst.server.tomcat.core;bundle-version="[1.1.106,1.2.0)",
org.eclipse.jst.server.tomcat.ui;bundle-version="[1.1.102,1.2.0)",
org.eclipse.jdt.core,
org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.1,1.5.0)",
org.eclipse.jst.j2ee;bundle-version="[1.1.301,2.0.0)",
org.eclipse.jdt.debug,
org.eclipse.jdt.debug.ui,
org.eclipse.debug.ui,
org.eclipse.wst.xml.core;bundle-version="[1.1.402,1.5.0)",
org.eclipse.core.expressions;bundle-version="3.4.101",
com.liferay.ide.eclipse.ui;bundle-version="1.0.0";visibility:=reexport,
org.eclipse.wst.ws.parser;bundle-version="[1.0.402,1.1.0)",
javax.wsdl;bundle-version="[1.5.1,1.7.0)",
org.eclipse.jst.common.frameworks;bundle-version="[1.1.300,1.2.0)",
org.apache.commons.logging,
org.apache.commons.collections,
org.eclipse.jst.common.project.facet.core,
org.apache.commons.httpclient,
org.apache.commons.codec;visibility:=reexport,
org.apache.commons.io;visibility:=reexport,
com.liferay.ide.eclipse.sdk
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.liferay.ide.eclipse.server.core,
com.liferay.ide.eclipse.server.core.support,
com.liferay.ide.eclipse.server.remote,
com.liferay.ide.eclipse.server.util
Bundle-ClassPath: .,
portal-support/deps/portal-impl.jar,
portal-support/deps/portal-service.jar
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay Server Core
Bundle-SymbolicName: com.liferay.ide.eclipse.server.core;singleton:=true
Bundle-Version: 1.3.0.qualifier
Bundle-Activator: com.liferay.ide.eclipse.server.core.LiferayServerCorePlugin
Bundle-Vendor: Liferay, Inc.
Require-Bundle: org.eclipse.ui,
org.eclipse.wst.server.core;bundle-version="[1.1.102,2.0.0)";visibility:=reexport,
org.eclipse.jst.server.core;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.debug.core,
org.eclipse.jdt.launching,
com.liferay.ide.eclipse.core,
org.eclipse.jst.server.tomcat.core;bundle-version="[1.1.106,1.2.0)",
org.eclipse.jst.server.tomcat.ui;bundle-version="[1.1.102,1.2.0)",
org.eclipse.jdt.core,
org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.1,1.5.0)",
org.eclipse.jst.j2ee;bundle-version="[1.1.301,2.0.0)",
org.eclipse.jdt.debug,
org.eclipse.jdt.debug.ui,
org.eclipse.debug.ui,
org.eclipse.wst.xml.core;bundle-version="[1.1.402,1.5.0)",
org.eclipse.core.expressions;bundle-version="3.4.101",
com.liferay.ide.eclipse.ui;bundle-version="1.0.0";visibility:=reexport,
org.eclipse.wst.ws.parser;bundle-version="[1.0.402,1.1.0)",
javax.wsdl;bundle-version="[1.5.1,1.7.0)",
org.eclipse.jst.common.frameworks;bundle-version="[1.1.300,1.2.0)",
org.eclipse.jst.common.project.facet.core,
org.apache.commons.httpclient,
org.apache.commons.codec;visibility:=reexport,
org.apache.commons.io;visibility:=reexport,
com.liferay.ide.eclipse.sdk
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.liferay.ide.eclipse.server.core,
com.liferay.ide.eclipse.server.core.support,
com.liferay.ide.eclipse.server.remote,
com.liferay.ide.eclipse.server.util
Bundle-ClassPath: .,
portal-support/deps/portal-impl.jar,
portal-support/deps/portal-service.jar
Expand Up @@ -888,6 +888,13 @@
</extension>
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
<runtime-component-version
type="com.liferay.ide.eclipse.server.runtime.stub.component"
version="6.0">
</runtime-component-version>
<runtime-component-type
id="com.liferay.ide.eclipse.server.runtime.stub.component">
</runtime-component-type>
<adapter>
<runtime-component
id="com.liferay.ide.eclipse.server.runtime.stub.component">
Expand All @@ -899,14 +906,10 @@
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider">
</type>
</adapter>
<runtime-component-version
type="com.liferay.ide.eclipse.server.runtime.stub.component"
version="6">
</runtime-component-version>
<supported>
<runtime-component
id="com.liferay.ide.eclipse.server.runtime.stub.component"
version="6">
version="6.0">
</runtime-component>
<facet
id="jst.web"
Expand Down Expand Up @@ -943,7 +946,7 @@
<runtimeFacetMapping
runtime-component="com.liferay.ide.eclipse.server.runtime.stub.component"
runtimeTypeId="com.liferay.ide.eclipse.server.runtime.stub"
version="6">
version="6.0">
</runtimeFacetMapping>
</extension>
<extension
Expand Down
@@ -1,55 +1,56 @@
package com.liferay.ide.eclipse.server.core;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
import org.eclipse.wst.server.core.IRuntime;


public class LiferayRuntimeStubClasspathProvider extends RuntimeClasspathProviderDelegate {

private static final NullProgressMonitor npm = new NullProgressMonitor();
protected RuntimeClasspathProviderDelegate stubDelegate = null;

public LiferayRuntimeStubClasspathProvider() {
super();
}

@Override
public IClasspathEntry[] resolveClasspathContainer( IProject project, IRuntime runtime ) {
IClasspathEntry[] retval = null;

if ( stubDelegate == null ) {
LiferayRuntimeStubDelegate delegate =
(LiferayRuntimeStubDelegate) runtime.loadAdapter( LiferayRuntimeStubDelegate.class, npm );

String runtimeStubTypeId = delegate.getRuntimeStubTypeId();

IConfigurationElement[] elements =
Platform.getExtensionRegistry().getConfigurationElementsFor(
"org.eclipse.jst.server.core.runtimeClasspathProviders" );

for ( IConfigurationElement element : elements ) {
String runtimeTypeIds = element.getAttribute( "runtimeTypeIds" );
if ( runtimeTypeIds.contains( runtimeStubTypeId ) ) {
try {
stubDelegate = (RuntimeClasspathProviderDelegate) element.createExecutableExtension( "class" );
}
catch ( CoreException e ) {
e.printStackTrace();
}
}
}
}

if ( stubDelegate != null ) {
retval = stubDelegate.resolveClasspathContainer( project, runtime );
}

return retval;
}
}
package com.liferay.ide.eclipse.server.core;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
import org.eclipse.wst.server.core.IRuntime;


public class LiferayRuntimeStubClasspathProvider extends RuntimeClasspathProviderDelegate {

private static final NullProgressMonitor npm = new NullProgressMonitor();
protected RuntimeClasspathProviderDelegate stubDelegate = null;

public LiferayRuntimeStubClasspathProvider() {
super();
}

@Override
public IClasspathEntry[] resolveClasspathContainer( IProject project, IRuntime runtime ) {
IClasspathEntry[] retval = null;

if ( stubDelegate == null ) {
LiferayRuntimeStubDelegate delegate =
(LiferayRuntimeStubDelegate) runtime.loadAdapter( LiferayRuntimeStubDelegate.class, npm );

String runtimeStubTypeId = delegate.getRuntimeStubTypeId();

IConfigurationElement[] elements =
Platform.getExtensionRegistry().getConfigurationElementsFor(
"org.eclipse.jst.server.core.runtimeClasspathProviders" );

for ( IConfigurationElement element : elements ) {
String runtimeTypeIds = element.getAttribute( "runtimeTypeIds" );
if ( runtimeTypeIds.contains( runtimeStubTypeId ) ) {
try {
stubDelegate = (RuntimeClasspathProviderDelegate) element.createExecutableExtension( "class" );
break;
}
catch ( CoreException e ) {
e.printStackTrace();
}
}
}
}

if ( stubDelegate != null ) {
retval = stubDelegate.resolveClasspathContainer( project, runtime );
}

return retval;
}
}

0 comments on commit 2978aca

Please sign in to comment.