Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2019-09-01 21:12:11 +0000
committerJan Belle2019-09-01 21:12:11 +0000
commita7409264ceddf20eafe5e8e17d907d1d59edf6bc (patch)
tree32d6503e0e9bd0bbe058ef720c0bbcb65f1d30a0 /plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice
parent54885fda766d9d033faff67294d42d475b8aa1e0 (diff)
downloadorg.eclipse.etrice-a7409264ceddf20eafe5e8e17d907d1d59edf6bc.tar.gz
org.eclipse.etrice-a7409264ceddf20eafe5e8e17d907d1d59edf6bc.tar.xz
org.eclipse.etrice-a7409264ceddf20eafe5e8e17d907d1d59edf6bc.zip
[ui] Remove maven support
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice')
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectConfigPage.java102
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectWizard.java41
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectCreator.java12
-rw-r--r--plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend233
4 files changed, 5 insertions, 383 deletions
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectConfigPage.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectConfigPage.java
deleted file mode 100644
index cc2f06bca..000000000
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectConfigPage.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 protos software gmbh (http://www.protos.de).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * CONTRIBUTORS:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator.ui.wizard;
-
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.etrice.generator.ui.preferences.PreferenceConstants;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
-
-/**
- * @author Henrik Rentz-Reichert
- *
- */
-class EmptyProjectConfigPage extends WizardPage {
-
- private Button jdtBuild;
- private Button mvnBuild;
- private boolean useJDTBuild;
-
- /**
- * @param pageName
- */
- EmptyProjectConfigPage(String pageName) {
- super(pageName);
- }
-
- @Override
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- initializeDialogUnits(parent);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- jdtBuild = new Button(composite, SWT.RADIO);
- jdtBuild.setText("use &Eclipse JDT build");
- jdtBuild.addSelectionListener(new SelectionListener() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- setPageComplete(validatePage());
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- mvnBuild = new Button(composite, SWT.RADIO);
- mvnBuild.setText("use &Maven build");
-
- ScopedPreferenceStore prefStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.etrice.generator.ui");
- if (prefStore.getString(PreferenceConstants.BUILD_KIND).equals(PreferenceConstants.MAVEN))
- mvnBuild.setSelection(true);
- else
- jdtBuild.setSelection(true);
-
- // Show description on opening
- setErrorMessage(null);
- setMessage(null);
- setControl(composite);
- Dialog.applyDialogFont(composite);
-
- setPageComplete(validatePage());
- }
-
- protected boolean validatePage() {
- useJDTBuild = jdtBuild==null || jdtBuild.getSelection();
-
- setErrorMessage(null);
-
- return true;
- }
-
- public boolean useJDTBuild() {
- return useJDTBuild;
- }
-
- public boolean useMVNBuild() {
- return !useJDTBuild;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectWizard.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectWizard.java
index 6cc9582c2..ab9ba4f9e 100644
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectWizard.java
+++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/EmptyProjectWizard.java
@@ -33,10 +33,7 @@ import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.etrice.generator.base.AbstractGeneratorOptions;
import org.eclipse.etrice.generator.ui.Activator;
-import org.eclipse.jdt.core.IAccessRule;
-import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.Wizard;
@@ -76,7 +73,6 @@ public class EmptyProjectWizard extends Wizard implements INewWizard {
protected IProject runtimeProject;
protected IProject modellibProject;
protected String initialProjectName;
- private EmptyProjectConfigPage config;
private static final String[] additionalLaunchConfigLines = new String[] { "<stringAttribute key=\"org.eclipse.debug.core.ATTR_REFRESH_SCOPE\" value=\"${workspace}\"/>" };
@@ -114,11 +110,6 @@ public class EmptyProjectWizard extends Wizard implements INewWizard {
newProjectCreationPage.setTitle("Template eTrice Project");
newProjectCreationPage.setDescription("Create the template Java project with eTrice dependencies");
addPage(newProjectCreationPage);
-
- config = new EmptyProjectConfigPage("config");
- config.setTitle("Project Configuration");
- config.setDescription("Choose a build type for the project");
- addPage(config);
}
@Override
@@ -129,29 +120,14 @@ public class EmptyProjectWizard extends Wizard implements INewWizard {
protected void execute(IProgressMonitor progressMonitor) {
try {
List<IProject> referencedProjects = new ArrayList<IProject>();
- if (config.useJDTBuild()) {
- if (runtimeProject != null)
- referencedProjects.add(runtimeProject);
- if (modellibProject != null)
- referencedProjects.add(modellibProject);
- }
+ if (runtimeProject != null)
+ referencedProjects.add(runtimeProject);
+ if (modellibProject != null)
+ referencedProjects.add(modellibProject);
ArrayList<String> natures = new ArrayList<String>(ProjectCreator.getCommonNatureIDs());
- if (config.useMVNBuild())
- natures.add("org.eclipse.m2e.core.maven2Nature");
-
ArrayList<String> builders = new ArrayList<String>(ProjectCreator.getCommonBuilderIDs());
- if (config.useMVNBuild())
- builders.add("org.eclipse.m2e.core.maven2Builder");
-
ArrayList<IClasspathEntry> pathEntries = new ArrayList<IClasspathEntry>();
- if (config.useMVNBuild()) {
- IClasspathEntry mvnContainer = JavaCore
- .newContainerEntry(new Path("org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"),
- new IAccessRule[] {}, new IClasspathAttribute[] { JavaCore
- .newClasspathAttribute("maven.pomderived", "true") }, false);
- pathEntries.add(mvnContainer);
- }
URI modelProjectURI = (projectLocation == null) ? null : URI.createFileURI(projectLocation
.toOSString());
@@ -171,12 +147,6 @@ public class EmptyProjectWizard extends Wizard implements INewWizard {
ProjectCreator.createLaunchJavaApplicationConfig(projectURI.appendSegment("run_Template.launch"),
projectName, MODEL_NAME, "Node_node_subSystemRefRunner");
- if (config.useMVNBuild()) {
- ProjectCreator.createMavenPOM(projectURI.appendSegment("pom.xml"), projectName, MODEL_NAME, "Node_node_subSystemRefRunner");
- ProjectCreator.createMavenBuilder(projectURI.appendSegment("build_" + modelName + ".launch"), projectName);
- ProjectCreator.createMavenLauncher(projectURI.appendSegment("runjar_" + modelName + ".launch"), projectName, MODEL_NAME);
- }
-
importContent(project, progressMonitor);
}
catch (Exception e) {
@@ -196,8 +166,7 @@ public class EmptyProjectWizard extends Wizard implements INewWizard {
return false;
}
- if (config.useJDTBuild())
- invokeLibraryWizard();
+ invokeLibraryWizard();
IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IFile roomFile = project.getFile("/model/" + MODEL_NAME + ".room");
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectCreator.java b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectCreator.java
index d7304ac1a..90b943750 100644
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectCreator.java
+++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectCreator.java
@@ -402,18 +402,6 @@ public class ProjectCreator {
}
}
- public static void createMavenPOM(URI uri, String project, String mdlName, String mainClass) {
- writeFile(uri, ProjectFileFragments.getMavenPOM(project, mdlName, mainClass));
- }
-
- public static void createMavenBuilder(URI uri, String project) {
- writeFile(uri, ProjectFileFragments.getMavenBuilder(project));
- }
-
- public static void createMavenLauncher(URI uri, String project, String mdlName) {
- writeFile(uri, ProjectFileFragments.getMavenLauncher(project, mdlName));
- }
-
/**
* @param project
* @param progressMonitor
diff --git a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend
index a027c1245..f1ce3fdd7 100644
--- a/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend
+++ b/plugins/org.eclipse.etrice.generator.ui/src/org/eclipse/etrice/generator/ui/wizard/ProjectFileFragments.xtend
@@ -146,237 +146,4 @@ class ProjectFileFragments {
</launchConfiguration>
'''
}
-
- def static String getMavenPOM(String project, String mdlName, String mainClass) {
- '''
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>«project»</groupId>
- <artifactId>«mdlName»</artifactId>
- <version>1.0.0</version>
-
- <repositories>
- <repository>
- <id>repo.eclipse.org-snapshots</id>
- <name>eTrice Repository - Snapshots</name>
- <url>https://repo.eclipse.org/content/repositories/etrice-snapshots/</url>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>repo.eclipse.org-snapshots</id>
- <name>eTrice Repository - Snapshots</name>
- <url>https://repo.eclipse.org/content/repositories/etrice-snapshots/</url>
- </pluginRepository>
- </pluginRepositories>
-
- <build>
- <sourceDirectory>src-gen</sourceDirectory>
- <resources>
- <resource>
- <directory>src-gen</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>src</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.etrice</groupId>
- <artifactId>org.eclipse.etrice.generator.java.mvn</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- <executions>
- <execution>
- <goals>
- <goal>eTriceJavaGenerator</goal>
- </goals>
- <configuration>
- <arguments>
- <!-- allowed switches for the generator (not complete) -->
- <!-- generate the store/restore interface using POJO data objects
- <param>-storeDataObj</param>
- -->
- <!-- generate MSC instrumentation
- <param>-msc_instr</param>
- -->
- <!-- generate the persistence interface for dynamic actors
- <param>-persistable</param>
- -->
- <!-- generate all ROOM classes as library
- <param>-lib</param>
- -->
- <!-- generate documentation
- <param>-genDocu</param>
- -->
- <!-- generate files incrementally (overwrite only if contents changed)
- <param>-inc</param>
- -->
- <param>model/«mdlName».etmap</param>
- </arguments>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <!-- put the modellib on the class path to allow resolution of models by the generator -->
- <dependency>
- <groupId>org.eclipse.etrice</groupId>
- <artifactId>org.eclipse.etrice.modellib.java</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- <archive>
- <manifest>
- <mainClass>«mdlName».«mainClass»</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.eclipse.etrice
- </groupId>
- <artifactId>
- org.eclipse.etrice.generator.java.mvn
- </artifactId>
- <versionRange>
- [0.5.0-SNAPSHOT,)
- </versionRange>
- <goals>
- <goal>
- eTriceJavaGenerator
- </goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.codehaus.mojo
- </groupId>
- <artifactId>
- build-helper-maven-plugin
- </artifactId>
- <versionRange>
- [1.7,)
- </versionRange>
- <goals>
- <goal>add-source</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.eclipse.etrice</groupId>
- <artifactId>org.eclipse.etrice.runtime.java</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.etrice</groupId>
- <artifactId>org.eclipse.etrice.modellib.java</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
- </project>
- '''
- }
-
- def static String getMavenBuilder(String project) {
- '''
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
- <booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
- <stringAttribute key="M2_GOALS" value="package"/>
- <booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
- <booleanAttribute key="M2_OFFLINE" value="false"/>
- <stringAttribute key="M2_PROFILES" value=""/>
- <listAttribute key="M2_PROPERTIES"/>
- <stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
- <booleanAttribute key="M2_SKIP_TESTS" value="false"/>
- <intAttribute key="M2_THREADS" value="1"/>
- <booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
- <booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
- <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/«project»}"/>
- </launchConfiguration>
- '''
- }
-
- def static String getMavenLauncher(String project, String mdlName) {
- '''
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
- <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:JAVA_HOME}/bin/java.exe"/>
- <stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-jar target/«mdlName»-1.0.0-jar-with-dependencies.jar"/>
- <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/«project»}"/>
- </launchConfiguration>
- '''
- }
} \ No newline at end of file

Back to the top