Skip to content
Snippets Groups Projects
Commit 37bee8f6 authored by Benguria Elguezabal, Gorka's avatar Benguria Elguezabal, Gorka
Browse files

y3

parent 51a6a6c6
No related branches found
No related tags found
No related merge requests found
Pipeline #139130 failed
Showing
with 18 additions and 388 deletions
version https://git-lfs.github.com/spec/v1
oid sha256:16ab14a0e9a656598d91cff0d517f46adaa533959545476d946ccb25fa9a15e5
size 602762175
......@@ -5,36 +5,43 @@ This repo contains
* Different versions of the Eclipse IDE for different platforms
## lfs repo
the zipped Eclipse IDEs are stored in a lfs repo in order to be able to access to them you need to have git-lfs installed https://git-lfs.github.com/. In order to minimize the network overload we have excluded the direct download of the IDEs when cloning therefore the download must be explicitly performed. We provided guidance to two different escenarios:
the zipped Eclipse IDEs are uploaded to a lfs repo. For that you need to have git-lfs installed https://git-lfs.github.com/. In order to minimize the network overload we have excluded the direct download of the IDEs when cloning therefore the download must be explicitly performed. We provided guidance to two different escenarios:
* IDE download
* IDE Upload
### IDE download
the procedure for a IDE user is the following
* install [git-lfs](https://git-lfs.com/) on your platform
**_NOTE: To make things easier, you can now download directly the binaries from this repository.
Just click in the top in the [Releases](https://git.code.tecnalia.com/piacere/private/ide_tool/-/releases) link, and you can select the version and platform to dowload._**
The standard procedure using LFS is the following:
* install git-lfs on your platform
* clone the repo
* choose your IDE
* download de concrete IDE
* choose the IDE to download
* download the concrete IDE
```
echo you require lfs, the following command must report the installed version otherwise install git-lfs
git lfs version
echo this is something that I have done to be able to migrate the repo to lfs and avoid timeout problems
git config lfs.activitytimeout 120
git clone https://git.code.tecnalia.com/piacere/private/ide_tool.git
cd ide_tool
echo choose your IDE
ls -l "ECLIPSE_BASED_IDE/DOML 1.0/WIN/Piacere.zip"
echo you are going to be asked for the artifactory credentials, if you do not have them as us gorka.benguria@tecnalia.com, inaki.etxaniz@tecnalia.com
git lfs pull --exclude= --include "ECLIPSE_BASED_IDE/DOML 1.0/WIN/Piacere.zip"
ls -l "ECLIPSE_BASED_IDE/DOML 1.0/WIN/Piacere.zip"
echo you should see a change in the size
echo you should see a change in the size of zip file. Also using "status" command
git status
echo it should report no changes
```
### IDE upload
* install [git-lfs](https://git-lfs.com/) on your platform
* install git-lfs on your platform
* clone the repo
* choose your IDE you want to upload
* replace
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
/bin/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PiacereIDEIntegration.KR03</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<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>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: KR03
Bundle-SymbolicName: PiacereIDEIntegration.KR03;singleton:=true
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: PiacereIDEIntegration.KR03
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.apache.httpcomponents.httpcore
Import-Package: eu.piacere.doml.doml.commons,
eu.piacere.piacereTool.utils,
org.apache.commons.io,
org.apache.http.client;version="4.5.13",
org.apache.http.client.methods;version="4.5.13",
org.apache.http.impl.client;version="4.5.13",
org.eclipse.core.resources,
org.eclipse.core.runtime.preferences;version="3.4.0",
org.eclipse.emf.common.util,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.resource,
org.eclipse.emf.ecore.resource.impl,
org.eclipse.emf.ecore.util,
org.json
Source Code/PiacereIDEIntegration.KR03/Piacere/PiacereIcon_16x16.png

2.02 KiB

source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
Piacere/
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.preferencePages">
<page
category="PiacereToolCustomization.preferences.page1"
class="eu.piacere.ide.toolIntegration.kr03.preferencePage.KR03PreferencePage"
id="PiacereIDEIntegration.KR03.preferences.page1"
name="Infrastructural Code Generator Preferences">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="eu.piacere.ide.toolIntegration.kr03.preferencePage.KR03PreferenceInitializer">
</initializer>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
categoryId="eu.piacere.piacereModelsCommands.category.id"
defaultHandler="eu.piacere.ide.toolIntegration.kr03.commandHandlers.CodeGeneratorCommandHandler"
id="eu.piacere.piacereModelsCommands.codeGeneratorCommand.id"
name="Generate Code">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:eu.piacere.eclipsePopupMenu.id">
<command
commandId="eu.piacere.piacereModelsCommands.codeGeneratorCommand.id"
icon="Piacere/PiacereIcon_16x16.png"
label="Generate IaC Code"
style="push"
tooltip="Generate IaC code using DOML">
<visibleWhen
checkEnabled="false">
<reference
definitionId="eu.piacere.piacereTool.propertyTesters.extensionPropertyTester.isDOMLXModel.id">
</reference>
</visibleWhen>
</command>
</menuContribution>
</extension>
</plugin>
package eu.piacere.ide.toolIntegration.kr03.commandHandlers;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
import org.json.JSONException;
import eu.piacere.piacereTool.utils.FileUtils;
import eu.piacere.piacereTool.utils.ToolCustomizationUtils;
public class CodeGeneratorCommandHandler extends AbstractHandler{
private void doPostRequestToValidator(String fileContent, String path, String defaultFileName) throws ClientProtocolException, IOException, JSONException {
HttpClient httpClient = HttpClientBuilder.create().build();
String url=ToolCustomizationUtils.getPreference(this.getClass(), "KR03.protocol")+"://"+ToolCustomizationUtils.getPreference(this.getClass(), "KR03.host")+":"+ToolCustomizationUtils.getPreference(this.getClass(), "KR03.port")+"/iac/files";
HttpPost httpPost = new HttpPost(url);
StringEntity entity = new StringEntity(fileContent);
httpPost.setEntity(entity);
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-type", "application/xml");
CloseableHttpResponse response = (CloseableHttpResponse) httpClient.execute(httpPost);
if(response.getStatusLine().getStatusCode()==200) {
String generationFileName=ToolCustomizationUtils.doDialogAsk("IaC Code Generator", "Enter the IaC Code File Name", defaultFileName);
FileOutputStream fos = new FileOutputStream(path + "//" + generationFileName+"_"+FileUtils.getTimestamp()+".tar.gz");
int br = -1;
byte[] buffer = new byte[4096];
while ((br = response.getEntity().getContent().read(buffer)) != -1 ) {
fos.write(buffer, 0, br);
}
fos.close();
}
else {
ToolCustomizationUtils.showErrorDialog("Code Generator", "Error: " + response.getStatusLine().getStatusCode() + ".\n\nCan not generate the IaC code.");
}
}
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ToolCustomizationUtils.saveWorkbench();
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof StructuredSelection) {
if(((StructuredSelection)selection).getFirstElement() instanceof IFile){
IFile res = (IFile)((StructuredSelection) selection).getFirstElement();
String fileContent=FileUtils.getIFileContents(res);
if(fileContent==null) {
return null;
}
String path = res.getLocation().removeLastSegments(1).toString();
try {
doPostRequestToValidator(fileContent, path, res.getFullPath().lastSegment().replace(".domlx", ""));
res.getParent().refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (IOException | JSONException | CoreException e2) {
e2.printStackTrace();
}
}
}
return null;
}
}
package eu.piacere.ide.toolIntegration.kr03.preferencePage;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.osgi.framework.FrameworkUtil;
import eu.piacere.ide.toolIntegration.kr03.preferencePage.KR03PreferenceInitializer;
public class KR03PreferenceInitializer extends AbstractPreferenceInitializer {
@Override
public void initializeDefaultPreferences() {
ScopedPreferenceStore scopedPreferenceStore = new ScopedPreferenceStore(ConfigurationScope.INSTANCE,(FrameworkUtil.getBundle(KR03PreferenceInitializer.class)).getSymbolicName());
scopedPreferenceStore.setDefault("KR03.host", "icg.ci.piacere.digital.tecnalia.dev");
scopedPreferenceStore.setDefault("KR03.port", 443);
scopedPreferenceStore.setDefault("KR03.protocol", "https");
}
}
\ No newline at end of file
package eu.piacere.ide.toolIntegration.kr03.preferencePage;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.osgi.framework.FrameworkUtil;
public class KR03PreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
public KR03PreferencePage() {
super(GRID);
}
@Override
public void init(IWorkbench workbench) {
//WHICH SCOPE SHOULD I SELECT: https://wiki.eclipse.org/FAQ_What_is_a_preference_scope%3F
setPreferenceStore(new ScopedPreferenceStore(ConfigurationScope.INSTANCE, (FrameworkUtil.getBundle(KR03PreferenceInitializer.class)).getSymbolicName()));
setDescription("These Are The Infrastructural Code Generator Preferences");
}
@Override
protected void createFieldEditors() {
addField(new StringFieldEditor("KR03.host", "Endpoint Host", getFieldEditorParent()));
addField(new IntegerFieldEditor("KR03.port", "Endpoint Port", getFieldEditorParent()));
addField(new RadioGroupFieldEditor("KR03.protocol", "Protocol", 1, new String[][] {{"HTTP","http"},{"HTTPS","https"}}, getFieldEditorParent()));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
/bin/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PiacereIDEIntegration.KR05</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<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>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: KR05
Bundle-SymbolicName: PiacereIDEIntegration.KR05;singleton:=true
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: PiacereIDEIntegration.KR05
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.apache.httpcomponents.httpcore
Import-Package: eu.piacere.doml.doml.commons,
eu.piacere.piacereTool.utils,
org.apache.commons.io,
org.apache.http.client;version="4.5.13",
org.apache.http.client.methods;version="4.5.13",
org.apache.http.impl.client;version="4.5.13",
org.eclipse.core.resources,
org.eclipse.core.runtime.preferences;version="3.4.0",
org.eclipse.emf.common.util,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.resource,
org.eclipse.emf.ecore.resource.impl,
org.eclipse.emf.ecore.util,
org.json
Source Code/PiacereIDEIntegration.KR05/Piacere/PiacereIcon_16x16.png

2.02 KiB

source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
Piacere/
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.preferencePages">
<page
category="PiacereToolCustomization.preferences.page1"
class="eu.piacere.ide.toolIntegration.kr05.preferencePage.KR05PreferencePage"
id="PiacereIDEIntegration.KR05.preferences.page1"
name="Model Checker Preferences">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="eu.piacere.ide.toolIntegration.kr05.preferencePage.KR05PreferenceInitializer">
</initializer>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
categoryId="eu.piacere.piacereModelsCommands.category.id"
defaultHandler="eu.piacere.ide.toolIntegration.kr05.commandHandlers.ValidateDOMLCommandHandler"
id="eu.piacere.piacereModelsCommands.validateDOMLCommand.id"
name="Validate DOML">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:eu.piacere.eclipsePopupMenu.id">
<command
commandId="eu.piacere.piacereModelsCommands.validateDOMLCommand.id"
icon="Piacere/PiacereIcon_16x16.png"
label="Validate DOML"
style="push"
tooltip="Validate the DOML Specification">
<visibleWhen
checkEnabled="false">
<reference
definitionId="eu.piacere.piacereTool.propertyTesters.extensionPropertyTester.isDOMLXModel.id">
</reference>
</visibleWhen>
</command>
</menuContribution>
</extension>
</plugin>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment