-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
2,281 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?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-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>SakerJavaIDEConfigurationParserPlugin</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: saker.java.ide.eclipse | ||
Bundle-SymbolicName: saker.java.ide.eclipse;singleton:=true | ||
Bundle-Version: 1.0.0.qualifier | ||
Automatic-Module-Name: saker.java.ide.eclipse | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Require-Bundle: saker.build.ide.eclipse;bundle-version="1.0.0", | ||
org.eclipse.core.resources;bundle-version="3.13.400", | ||
org.eclipse.core.runtime;bundle-version="3.15.300", | ||
org.eclipse.jdt.core;bundle-version="3.18.0", | ||
org.eclipse.jdt.launching;bundle-version="3.14.0", | ||
org.eclipse.swt;bundle-version="3.111.0", | ||
org.eclipse.jdt.ui;bundle-version="3.18.0", | ||
org.eclipse.ui;bundle-version="3.113.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
plugin.xml,\ | ||
icons/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<plugin> | ||
<extension | ||
id="saker.java.ide.eclipse.extension.ideConfigurationTypeHandler" | ||
name="Java IDE configuration handler" | ||
point="saker.build.ide.eclipse.extension.ideConfigurationTypeHandler"> | ||
<parser class="saker.java.ide.eclipse.JavaIDEConfigurationTypeHandler" type="saker.java.compile.ide.configuration" type_name="Java"> | ||
</parser> | ||
</extension> | ||
<extension | ||
id="saker.java.ide.eclipse.extension.params.installation.environmentUserParameterContributor" | ||
name="Java Installation Environment Parameter Contributor" | ||
point="saker.build.ide.eclipse.extension.environmentUserParameterContributor"> | ||
<contributor | ||
class="saker.java.ide.eclipse.params.JavaInstallationEnvironmentUserParameterContributor"></contributor> | ||
</extension> | ||
</plugin> |
75 changes: 75 additions & 0 deletions
75
src/saker/java/ide/eclipse/AddExportsContainerProjectConfigurationEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package saker.java.ide.eclipse; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.TreeSet; | ||
|
||
import org.eclipse.jdt.core.IClasspathAttribute; | ||
import org.eclipse.jdt.core.JavaCore; | ||
import org.eclipse.jdt.ui.JavaUI; | ||
import org.eclipse.swt.graphics.Image; | ||
import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
|
||
import saker.build.ide.eclipse.extension.ideconfig.AbstractIDEProjectConfigurationEntry; | ||
import saker.build.ide.eclipse.extension.ideconfig.IIDEProjectConfigurationEntry; | ||
|
||
public class AddExportsContainerProjectConfigurationEntry extends AbstractIDEProjectConfigurationEntry { | ||
private static final Image IMG_ENTRY = JavaIDEConfigurationTypeHandler.getComposedImage( | ||
AbstractUIPlugin.imageDescriptorFromPlugin(JavaUI.ID_PLUGIN, "icons/full/obj16/module_obj.png"), null); | ||
|
||
private List<AddExportsProjectConfigurationEntry> addExportEntries = new ArrayList<>(); | ||
|
||
public AddExportsContainerProjectConfigurationEntry(Collection<AddExportsData> addexportscoll) { | ||
for (AddExportsData addexport : addexportscoll) { | ||
addExportEntries.add(new AddExportsProjectConfigurationEntry(addexport)); | ||
} | ||
} | ||
|
||
public void contribute(List<IClasspathAttribute> extraattrlist) { | ||
Set<String> exports = new TreeSet<>(); | ||
for (AddExportsProjectConfigurationEntry entry : addExportEntries) { | ||
if (!entry.isSelected()) { | ||
continue; | ||
} | ||
exports.addAll(entry.getAddExports().toCommandLineStrings()); | ||
} | ||
if (exports.isEmpty()) { | ||
//nothing to modify | ||
return; | ||
} | ||
for (Iterator<IClasspathAttribute> it = extraattrlist.iterator(); it.hasNext();) { | ||
IClasspathAttribute a = it.next(); | ||
if (IClasspathAttribute.ADD_EXPORTS.equals(a.getName())) { | ||
for (String cmdopd : a.getValue().split(":")) { | ||
exports.add(cmdopd); | ||
} | ||
it.remove(); | ||
} | ||
} | ||
extraattrlist.add(JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, String.join(":", exports))); | ||
} | ||
|
||
@Override | ||
public IIDEProjectConfigurationEntry[] getSubEntries() { | ||
return addExportEntries.toArray(new AddExportsProjectConfigurationEntry[addExportEntries.size()]); | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return "Add exports"; | ||
} | ||
|
||
@Override | ||
public Image getImage() { | ||
return IMG_ENTRY; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getClass().getSimpleName() + "[addExports=" + addExportEntries + "]"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package saker.java.ide.eclipse; | ||
|
||
import java.util.Collection; | ||
import java.util.Set; | ||
import java.util.TreeSet; | ||
|
||
public class AddExportsData { | ||
public final String module; | ||
public final String pack; | ||
public final Set<String> target; | ||
|
||
public AddExportsData(String module, String pack, Set<String> target) { | ||
this.module = module; | ||
this.pack = pack; | ||
this.target = target; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((module == null) ? 0 : module.hashCode()); | ||
result = prime * result + ((pack == null) ? 0 : pack.hashCode()); | ||
result = prime * result + ((target == null) ? 0 : target.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
AddExportsData other = (AddExportsData) obj; | ||
if (module == null) { | ||
if (other.module != null) | ||
return false; | ||
} else if (!module.equals(other.module)) | ||
return false; | ||
if (pack == null) { | ||
if (other.pack != null) | ||
return false; | ||
} else if (!pack.equals(other.pack)) | ||
return false; | ||
if (target == null) { | ||
if (other.target != null) | ||
return false; | ||
} else if (!target.equals(other.target)) | ||
return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
//don't modify, keep this as the command line representation | ||
return module + "/" + pack + "=" + String.join(",", target); | ||
} | ||
|
||
public Collection<String> toCommandLineStrings() { | ||
Collection<String> result = new TreeSet<>(); | ||
for (String targetstr : target) { | ||
result.add(module + "/" + pack + "=" + targetstr); | ||
} | ||
return result; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/saker/java/ide/eclipse/AddExportsProjectConfigurationEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package saker.java.ide.eclipse; | ||
|
||
import org.eclipse.jdt.ui.JavaUI; | ||
import org.eclipse.swt.graphics.Image; | ||
import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
|
||
import saker.build.ide.eclipse.extension.ideconfig.AbstractIDEProjectConfigurationEntry; | ||
|
||
public class AddExportsProjectConfigurationEntry extends AbstractIDEProjectConfigurationEntry { | ||
private static final Image IMG_ENTRY = JavaIDEConfigurationTypeHandler.getComposedImage( | ||
AbstractUIPlugin.imageDescriptorFromPlugin(JavaUI.ID_PLUGIN, "icons/full/obj16/module_obj.png"), | ||
AbstractUIPlugin.imageDescriptorFromPlugin(JavaIDEConfigurationTypeHandler.PLUGIN_ID, "icons/add_sub.png")); | ||
|
||
private AddExportsData addExports; | ||
|
||
public AddExportsProjectConfigurationEntry(AddExportsData addExports) { | ||
this.addExports = addExports; | ||
} | ||
|
||
public AddExportsData getAddExports() { | ||
return addExports; | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return addExports.toString(); | ||
} | ||
|
||
@Override | ||
public Image getImage() { | ||
return IMG_ENTRY; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getClass().getSimpleName() + "[addExports=" + addExports + "]"; | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/saker/java/ide/eclipse/ClassPathConfigurationEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package saker.java.ide.eclipse; | ||
|
||
import java.util.Collection; | ||
|
||
import org.eclipse.jdt.core.IClasspathEntry; | ||
|
||
import saker.build.ide.eclipse.extension.ideconfig.IIDEProjectConfigurationEntry; | ||
|
||
public interface ClassPathConfigurationEntry extends IIDEProjectConfigurationEntry { | ||
public void contribute(Collection<IClasspathEntry> entries); | ||
} |
84 changes: 84 additions & 0 deletions
84
src/saker/java/ide/eclipse/ClassPathContainerConfigurationEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package saker.java.ide.eclipse; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.LinkedHashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import org.eclipse.jdt.core.IClasspathEntry; | ||
import org.eclipse.jdt.ui.JavaUI; | ||
import org.eclipse.swt.graphics.Image; | ||
|
||
import saker.build.ide.eclipse.extension.ideconfig.AbstractIDEProjectConfigurationEntry; | ||
import saker.build.ide.eclipse.extension.ideconfig.IIDEProjectConfigurationEntry; | ||
|
||
public class ClassPathContainerConfigurationEntry extends AbstractIDEProjectConfigurationEntry | ||
implements ClassPathConfigurationEntry { | ||
private static final Image IMG_ENTRY = JavaIDEConfigurationTypeHandler.getImageFromPlugin(JavaUI.ID_PLUGIN, | ||
"icons/full/obj16/library_obj.png"); | ||
|
||
private List<ClassPathConfigurationEntry> classpathEntries = new ArrayList<>(); | ||
private transient Set<ClassPathConfigurationEntry> removalClasspathEntries = new LinkedHashSet<>(); | ||
|
||
public ClassPathContainerConfigurationEntry() { | ||
} | ||
|
||
public void addClassPathEntry(ClassPathConfigurationEntry entry) { | ||
this.classpathEntries.add(entry); | ||
} | ||
|
||
public void addRemovalClassPathEntry(ClassPathConfigurationEntry entry) { | ||
this.removalClasspathEntries.add(entry); | ||
} | ||
|
||
public boolean isEmpty() { | ||
return classpathEntries.isEmpty(); | ||
} | ||
|
||
public void initSelection() { | ||
for (ClassPathConfigurationEntry cpentry : classpathEntries) { | ||
if (cpentry.isSelected()) { | ||
this.setSelected(true); | ||
return; | ||
} | ||
} | ||
this.setSelected(false); | ||
} | ||
|
||
@Override | ||
public void contribute(Collection<IClasspathEntry> entries) { | ||
for (ClassPathConfigurationEntry sentry : removalClasspathEntries) { | ||
if (!sentry.isSelected()) { | ||
continue; | ||
} | ||
sentry.contribute(entries); | ||
} | ||
for (ClassPathConfigurationEntry sentry : classpathEntries) { | ||
if (!sentry.isSelected() || removalClasspathEntries.contains(sentry)) { | ||
continue; | ||
} | ||
sentry.contribute(entries); | ||
} | ||
} | ||
|
||
@Override | ||
public IIDEProjectConfigurationEntry[] getSubEntries() { | ||
return classpathEntries.toArray(new IIDEProjectConfigurationEntry[0]); | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return "Classpath"; | ||
} | ||
|
||
@Override | ||
public Image getImage() { | ||
return IMG_ENTRY; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getClass().getSimpleName() + "[" + classpathEntries + "]"; | ||
} | ||
} |
Oops, something went wrong.