Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Ant buid script export
Ant buid script export [message #471681] Wed, 05 August 2009 14:48 Go to next message
Ivica Loncar is currently offline Ivica Loncar
Messages: 41
Registered: July 2009
Member
I had problems creating ant build script for an aspectj plugin and found
out that there is a difference in BuildPluginAction between PDE version of
a class and AJDT version of the class.

The PDE version of makeScripts method contains:

...

generator.setBuildingOSGi(true);
// allow binary cycles
Properties properties = new Properties();

properties.put(IBuildPropertiesConstants.PROPERTY_ALLOW_BINA RY_CYCLES, "true");
//$NON-NLS-1$
generator.setImmutableAntProperties(properties);
IPluginModelBase model = PluginRegistry.findModel(project);
if (model != null && model.getPluginBase().getId() != null) {
generator.setBundles(new BundleDescription[]
{model.getBundleDescription()});
generator.generate();
} else {
MessageDialog.openError(null,
PDEUIMessages.BuildPluginAction_ErrorDialog_Title,
PDEUIMessages.BuildPluginAction_ErrorDialog_Message);
}

while AJDT version of makescripts method has only:

generator.setBuildingOSGi(true);
IPluginModelBase model =
PDECore.getDefault().getModelManager().findModel(project);
generator.setElements(new String[] { "plugin@"
+model.getPluginBase().getId() }); //$NON-NLS-1$
generator.generate();


I think those two should be the same.
Re: Ant buid script export [message #472652 is a reply to message #471681] Wed, 05 August 2009 15:33 Go to previous messageGo to next message
Ivica Loncar is currently offline Ivica Loncar
Messages: 41
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------070105060405000504040006
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit


Here's the patch.




--------------070105060405000504040006
Content-Type: text/x-patch;
name="ajdt_ui_ant_export.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ajdt_ui_ant_export.patch"

### Eclipse Workspace Patch 1.0
#P org.eclipse.ajdt.ui
Index: src/org/eclipse/ajdt/internal/ui/actions/BuildPluginAction.j ava
============================================================ =======
RCS file: /cvsroot/tools/org.eclipse.ajdt/AJDT_src/org.eclipse.ajdt.ui /src/org/eclipse/ajdt/internal/ui/actions/BuildPluginAction. java,v
retrieving revision 1.15
diff -u -r1.15 BuildPluginAction.java
--- src/org/eclipse/ajdt/internal/ui/actions/BuildPluginAction.j ava 19 Jul 2008 00:20:32 -0000 1.15
+++ src/org/eclipse/ajdt/internal/ui/actions/BuildPluginAction.j ava 5 Aug 2009 19:32:33 -0000
@@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.Properties;

import org.eclipse.ajdt.core.AspectJCorePreferences;
import org.eclipse.ajdt.core.exports.AJBuildScriptGenerator;
@@ -23,11 +24,16 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.pde.core.plugin.IPluginModelBase;
+import org.eclipse.pde.core.plugin.PluginRegistry;
import org.eclipse.pde.internal.build.AbstractScriptGenerator;
+import org.eclipse.pde.internal.build.IBuildPropertiesConstants;
import org.eclipse.pde.internal.core.ClasspathHelper;
import org.eclipse.pde.internal.core.PDECore;
import org.eclipse.pde.internal.core.TargetPlatformHelper;
+import org.eclipse.pde.internal.ui.PDEUIMessages;
import org.eclipse.pde.internal.ui.build.BaseBuildAction;

/**
@@ -61,9 +67,22 @@
generator.setNextId(TargetPlatformHelper.getPDEState().getNe xtId());
generator.setStateExtraData(TargetPlatformHelper.getBundleCl asspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDE State()));
generator.setBuildingOSGi(true);
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(project);
- generator.setElements(new String[] { "plugin@" +model.getPluginBase().getId() }); //$NON-NLS-1$
- generator.generate();
+
+// IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(project);
+// generator.setElements(new String[] { "plugin@" +model.getPluginBase().getId() }); //$NON-NLS-1$
+// generator.generate();
+
+ // allow binary cycles
+ Properties properties = new Properties();
+ properties.put(IBuildPropertiesConstants.PROPERTY_ALLOW_BINA RY_CYCLES, "true"); //$NON-NLS-1$
+ generator.setImmutableAntProperties(properties);
+ IPluginModelBase model = PluginRegistry.findModel(project);
+ if (model != null && model.getPluginBase().getId() != null) {
+ generator.setBundles(new BundleDescription[] {model.getBundleDescription()});
+ generator.generate();
+ } else {
+ MessageDialog.openError(null, PDEUIMessages.BuildPluginAction_ErrorDialog_Title, PDEUIMessages.BuildPluginAction_ErrorDialog_Message);
+ }
}

private List getAspectpath(IProject project) {

--------------070105060405000504040006--
Re: Ant buid script export [message #477196 is a reply to message #471681] Wed, 05 August 2009 23:56 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 77
Registered: July 2009
Member
Thanks. I will get your patch into the next dev build of AJDT for 3.5.

Would you please raise a bug on bugzilla and attach the patch?

http://bugs.eclipse.org


--a

On 05/08/09 11:48 AM, in article
b2d6a249830cadb456399472788044bb$1@www.eclipse.org, "Ivica Loncar"
<iloncar.ml@gmail.com> wrote:

>
> I had problems creating ant build script for an aspectj plugin and found
> out that there is a difference in BuildPluginAction between PDE version of
> a class and AJDT version of the class.
>
> The PDE version of makeScripts method contains:
>
> ..
>
>
> generator.setBuildingOSGi(true);
> // allow binary cycles
> Properties properties = new Properties();
>
> properties.put(IBuildPropertiesConstants.PROPERTY_ALLOW_BINA RY_CYCLES, "true");
> //$NON-NLS-1$
> generator.setImmutableAntProperties(properties);
> IPluginModelBase model = PluginRegistry.findModel(project);
> if (model != null && model.getPluginBase().getId() != null) {
> generator.setBundles(new BundleDescription[]
> {model.getBundleDescription()});
> generator.generate();
> } else {
> MessageDialog.openError(null,
> PDEUIMessages.BuildPluginAction_ErrorDialog_Title,
> PDEUIMessages.BuildPluginAction_ErrorDialog_Message);
> }
>
> while AJDT version of makescripts method has only:
>
> generator.setBuildingOSGi(true);
> IPluginModelBase model =
> PDECore.getDefault().getModelManager().findModel(project);
> generator.setElements(new String[] { "plugin@"
> +model.getPluginBase().getId() }); //$NON-NLS-1$
> generator.generate();
>
>
> I think those two should be the same.
>
>
>
Re: Ant buid script export [message #478121 is a reply to message #477196] Thu, 06 August 2009 04:29 Go to previous message
Ivica Loncar is currently offline Ivica Loncar
Messages: 41
Registered: July 2009
Member
Hello Andrew,

> Thanks. I will get your patch into the next dev build of AJDT for
> 3.5.
>
> Would you please raise a bug on bugzilla and attach the patch?

Done.
Re: Ant buid script export [message #600432 is a reply to message #471681] Wed, 05 August 2009 15:33 Go to previous message
Ivica Loncar is currently offline Ivica Loncar
Messages: 41
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------070105060405000504040006
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit


Here's the patch.




--------------070105060405000504040006
Content-Type: text/x-patch;
name="ajdt_ui_ant_export.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ajdt_ui_ant_export.patch"

### Eclipse Workspace Patch 1.0
#P org.eclipse.ajdt.ui
Index: src/org/eclipse/ajdt/internal/ui/actions/BuildPluginAction.j ava
============================================================ =======
RCS file: /cvsroot/tools/org.eclipse.ajdt/AJDT_src/org.eclipse.ajdt.ui /src/org/eclipse/ajdt/internal/ui/actions/BuildPluginAction. java,v
retrieving revision 1.15
diff -u -r1.15 BuildPluginAction.java
--- src/org/eclipse/ajdt/internal/ui/actions/BuildPluginAction.j ava 19 Jul 2008 00:20:32 -0000 1.15
+++ src/org/eclipse/ajdt/internal/ui/actions/BuildPluginAction.j ava 5 Aug 2009 19:32:33 -0000
@@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.Properties;

import org.eclipse.ajdt.core.AspectJCorePreferences;
import org.eclipse.ajdt.core.exports.AJBuildScriptGenerator;
@@ -23,11 +24,16 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.pde.core.plugin.IPluginModelBase;
+import org.eclipse.pde.core.plugin.PluginRegistry;
import org.eclipse.pde.internal.build.AbstractScriptGenerator;
+import org.eclipse.pde.internal.build.IBuildPropertiesConstants;
import org.eclipse.pde.internal.core.ClasspathHelper;
import org.eclipse.pde.internal.core.PDECore;
import org.eclipse.pde.internal.core.TargetPlatformHelper;
+import org.eclipse.pde.internal.ui.PDEUIMessages;
import org.eclipse.pde.internal.ui.build.BaseBuildAction;

/**
@@ -61,9 +67,22 @@
generator.setNextId(TargetPlatformHelper.getPDEState().getNe xtId());
generator.setStateExtraData(TargetPlatformHelper.getBundleCl asspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDE State()));
generator.setBuildingOSGi(true);
- IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(project);
- generator.setElements(new String[] { "plugin@" +model.getPluginBase().getId() }); //$NON-NLS-1$
- generator.generate();
+
+// IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(project);
+// generator.setElements(new String[] { "plugin@" +model.getPluginBase().getId() }); //$NON-NLS-1$
+// generator.generate();
+
+ // allow binary cycles
+ Properties properties = new Properties();
+ properties.put(IBuildPropertiesConstants.PROPERTY_ALLOW_BINA RY_CYCLES, "true"); //$NON-NLS-1$
+ generator.setImmutableAntProperties(properties);
+ IPluginModelBase model = PluginRegistry.findModel(project);
+ if (model != null && model.getPluginBase().getId() != null) {
+ generator.setBundles(new BundleDescription[] {model.getBundleDescription()});
+ generator.generate();
+ } else {
+ MessageDialog.openError(null, PDEUIMessages.BuildPluginAction_ErrorDialog_Title, PDEUIMessages.BuildPluginAction_ErrorDialog_Message);
+ }
}

private List getAspectpath(IProject project) {

--------------070105060405000504040006--
Re: Ant buid script export [message #600457 is a reply to message #471681] Wed, 05 August 2009 23:56 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 77
Registered: July 2009
Member
Thanks. I will get your patch into the next dev build of AJDT for 3.5.

Would you please raise a bug on bugzilla and attach the patch?

http://bugs.eclipse.org


--a

On 05/08/09 11:48 AM, in article
b2d6a249830cadb456399472788044bb$1@www.eclipse.org, "Ivica Loncar"
<iloncar.ml@gmail.com> wrote:

>
> I had problems creating ant build script for an aspectj plugin and found
> out that there is a difference in BuildPluginAction between PDE version of
> a class and AJDT version of the class.
>
> The PDE version of makeScripts method contains:
>
> ..
>
>
> generator.setBuildingOSGi(true);
> // allow binary cycles
> Properties properties = new Properties();
>
> properties.put(IBuildPropertiesConstants.PROPERTY_ALLOW_BINA RY_CYCLES, "true");
> //$NON-NLS-1$
> generator.setImmutableAntProperties(properties);
> IPluginModelBase model = PluginRegistry.findModel(project);
> if (model != null && model.getPluginBase().getId() != null) {
> generator.setBundles(new BundleDescription[]
> {model.getBundleDescription()});
> generator.generate();
> } else {
> MessageDialog.openError(null,
> PDEUIMessages.BuildPluginAction_ErrorDialog_Title,
> PDEUIMessages.BuildPluginAction_ErrorDialog_Message);
> }
>
> while AJDT version of makescripts method has only:
>
> generator.setBuildingOSGi(true);
> IPluginModelBase model =
> PDECore.getDefault().getModelManager().findModel(project);
> generator.setElements(new String[] { "plugin@"
> +model.getPluginBase().getId() }); //$NON-NLS-1$
> generator.generate();
>
>
> I think those two should be the same.
>
>
>
Re: Ant buid script export [message #600466 is a reply to message #477196] Thu, 06 August 2009 04:29 Go to previous message
Ivica Loncar is currently offline Ivica Loncar
Messages: 41
Registered: July 2009
Member
Hello Andrew,

> Thanks. I will get your patch into the next dev build of AJDT for
> 3.5.
>
> Would you please raise a bug on bugzilla and attach the patch?

Done.
Previous Topic:development branch of AJDT
Next Topic:Dev vs Prod aspects?
Goto Forum:
  


Current Time: Tue Sep 02 05:26:59 EDT 2014

Powered by FUDForum. Page generated in 0.03754 seconds