Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: machaval/mule-intellij-plugins
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: javaduke/mule-intellij-plugins
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 5 commits
  • 12 files changed
  • 2 contributors

Commits on Dec 26, 2017

  1. Copy the full SHA
    cc45e5e View commit details

Commits on Jan 3, 2018

  1. Another schema provider improvement

    JavaDuke committed Jan 3, 2018
    Copy the full SHA
    645ecfd View commit details
  2. Schema provider fixes

    JavaDuke committed Jan 3, 2018
    Copy the full SHA
    275c50d View commit details

Commits on Jan 19, 2018

  1. NPE fix

    Eugene Berman committed Jan 19, 2018
    Copy the full SHA
    396136b View commit details

Commits on May 21, 2018

  1. Misc build tweaks

    Eugene Berman committed May 21, 2018
    Copy the full SHA
    48dc86f View commit details
1 change: 1 addition & 0 deletions data-weave-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ dependencies {
}

intellij {
version = ideaVersion
pluginName = 'data-weave-plugin'
publish {
pluginId '8458'
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ideaVersion = 2016.3.5
#ideaVersion = 171.3780.95
ideaVersion = 2017.3.1
ideaVersion = IC-2017.3.1
javaVersion = 1.8
ijPluginRepoChannel = alpha
version = 0.14
2 changes: 1 addition & 1 deletion mule-esb-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ sourceSets {
}

intellij {
version ideaVersion
version = ideaVersion
//plugins = ["maven", "groovy", 'properties', 'org.mule.tooling.intellij.dataweave', 'org.mule.tooling.intellij.raml']
plugins = ["maven", "Groovy", 'properties', project(':data-weave-plugin'), project(':raml-plugin')]
pluginName = 'mule-esb-plugin'
Original file line number Diff line number Diff line change
@@ -7,22 +7,25 @@
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.search.FilenameIndex;
import com.intellij.psi.search.GlobalSearchScope;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugin.logging.SystemStreamLog;
import org.mule.tooling.esb.launcher.configuration.archive.MuleAppManager;
import org.mule.tooling.esb.util.MuleConfigUtils;
import org.mule.tooling.lang.raml.file.RamlFileType;
import org.mule.tooling.lang.raml.util.RamlIcons;
import org.mule.tools.apikit.Scaffolder;
import org.mule.tools.apikit.ScaffolderAPI;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.*;

public class APIKitScaffoldingAction extends AnAction
{
@@ -51,8 +54,19 @@ public void actionPerformed(AnActionEvent anActionEvent)
final List<File> ramlFiles = new ArrayList<File>();
final File ramlFile = new File(file.getPath());
ramlFiles.add(ramlFile);

//TODO - list all RAML files in the project and add them too?
// Collection<VirtualFile> ramlFilesInProject = FilenameIndex.getAllFilesByExt(project, "raml", GlobalSearchScope.projectScope(project));
// for (VirtualFile vFile : ramlFilesInProject) {
// ramlFiles.add(new File(vFile.getPath()));
// }

//TODO - go through the list of modules and see if any one of them is a Mule domain
// if (MuleConfigUtils.isMuleDomainModule(module))

try
{
//TODO Mule version should be derived from Maven project?
new IdeaScaffolderAPI().execute(ramlFiles, appDir, null, "3.8");
} catch (RuntimeException e) {
logger.error("FINALLY CAUGHT RAML ERROR! ", e);
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
package org.mule.tooling.esb.config.completion;

import com.intellij.javaee.ExternalResourceManager;
import com.intellij.javaee.ResourceRegistrar;
import com.intellij.javaee.StandardResourceProvider;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectLocator;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.roots.OrderRootType;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.roots.libraries.Library;
@@ -66,8 +74,10 @@ public XmlFile getSchema(@NotNull @NonNls String url, @Nullable final Module mod
}
try {
Map<String, XmlFile> schemas = getSchemas(module);
if (schemas != null)
return schemas.get(url);
if (schemas != null) {
XmlFile schemaFile = schemas.get(url);
return schemaFile;
}
} catch (Exception e) {
//e.printStackTrace();
}
@@ -127,8 +137,21 @@ public Set<String> getLocations(@NotNull @NonNls final String namespace, @NotNul
for (Map.Entry<String, XmlFile> entry : schemas.entrySet()) {
final String s = getNamespace(entry.getValue(), context.getProject());
if (s != null && s.equals(namespace)) {
if (!entry.getKey().contains("mule-httpn.xsd"))
if (!entry.getKey().contains("mule-httpn.xsd")) {
locations.add(entry.getKey()); //Observe the formatting rules
XmlFile schemaFile = entry.getValue();
try {
String url = schemaFile.getVirtualFile().getUrl();
if (url != null) {
if (url.startsWith("jar://"))
url = url.substring(6);
ExternalResourceManager.getInstance().addResource(namespace, url);
}
} catch (Throwable ex) {
Notifications.Bus.notify(new Notification("Schema Provider", "Schema Provider", ex.toString(),
NotificationType.ERROR));
}
}
}
}
} catch (Exception e) {
@@ -157,6 +180,7 @@ public Result<Map<String, XmlFile>> compute() {
}

//============================================================================================================

@NotNull
private CachedValueProvider.Result<Map<String, XmlFile>> computeSchemas(@NotNull Module module) throws Exception {
final Project project = module.getProject();
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ public File getMuleApp(final Module module) throws ExecutionException

File applicationZip = null;
final File[] zips = outputDir.listFiles((dir, name) -> name.endsWith("zip"));
if (zips.length > 0)
if (zips != null && zips.length > 0)
{
applicationZip = zips[0];
}
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ public void setMuleVersion(String muleVersion) {

public void setMuleFacet(Module module) {
FacetType type = FacetTypeRegistry.getInstance().findFacetType(MuleFacet.ID);
Facet facet = type.createFacet(module, "Mule", type.createDefaultConfiguration(), null);
Facet facet = type.createFacet(module, type.getPresentableName(), type.createDefaultConfiguration(), null);
ModifiableFacetModel model = FacetManager.getInstance(module).createModifiableModel();
model.addFacet(facet);
model.commit();
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#%RAML 0.8
#%RAML 1.0
title: MyAPI
version: 1.0
baseUri: http://com.foo.bar/api
11 changes: 10 additions & 1 deletion raml-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
}

configurations {
compile.exclude module: 'xml-apis'
gen
// compile.exclude module: 'xml-apis'
all*.exclude group: 'xml-apis', module: 'xml-apis'
all*.exclude module: 'commons-logging'
all*.exclude group: 'org.slf4j'
@@ -11,6 +19,7 @@ dependencies {
}

intellij {
version = ideaVersion
plugins = ["yaml"]
pluginName = 'raml-plugin'
publish {
4 changes: 0 additions & 4 deletions raml-plugin/docs/Readme.md
Original file line number Diff line number Diff line change
@@ -7,10 +7,6 @@

[Installation](#installation)

[Creating DataWeave files](#creating-dataweave-files)

[Run/Debug configurations](#rundebug-configurations)

## Features
- Supports RAML 0.8 and RAML 1.0
- Syntax highlighting and auto completion
2 changes: 1 addition & 1 deletion raml-plugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin version="2">
<id>org.mule.tooling.intellij.raml</id>
<name>RAML Plugin For IntelliJ</name>
<version>0.13</version>
<version>0.14</version>
<vendor email="achaval@gmail.com" url="https://github.com/machaval/mule-esb-plugin">Mariano Achaval</vendor>
<description><![CDATA[
RAML Plugin For IntelliJ
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include 'data-weave-plugin'
include 'raml-plugin'
include 'data-weave-plugin'
include 'mule-esb-plugin'