diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 000000000..4dc2fa861
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 000000000..91ace1aaf
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dictionaries/Alexey_Andreev.xml b/.idea/dictionaries/Alexey_Andreev.xml
deleted file mode 100644
index 3fb8eccc0..000000000
--- a/.idea/dictionaries/Alexey_Andreev.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 7f7428a5d..d8a5e0eb2 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -115,7 +115,7 @@
-
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 000000000..ec13cf2f5
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 954f431a8..a6391bb86 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -10,6 +10,7 @@
+
diff --git a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilder.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilder.java
new file mode 100644
index 000000000..192dbd313
--- /dev/null
+++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilder.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2016 Alexey Andreev.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.teavm.idea.jps;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.jps.ModuleChunk;
+import org.jetbrains.jps.builders.DirtyFilesHolder;
+import org.jetbrains.jps.builders.java.JavaSourceRootDescriptor;
+import org.jetbrains.jps.incremental.BuilderCategory;
+import org.jetbrains.jps.incremental.CompileContext;
+import org.jetbrains.jps.incremental.ModuleBuildTarget;
+import org.jetbrains.jps.incremental.ModuleLevelBuilder;
+import org.jetbrains.jps.incremental.ProjectBuildException;
+import org.jetbrains.jps.model.java.JpsJavaExtensionService;
+import org.jetbrains.jps.model.library.JpsLibrary;
+import org.jetbrains.jps.model.library.JpsOrderRootType;
+import org.jetbrains.jps.model.module.JpsDependencyElement;
+import org.jetbrains.jps.model.module.JpsLibraryDependency;
+import org.jetbrains.jps.model.module.JpsModule;
+import org.jetbrains.jps.model.module.JpsModuleDependency;
+import org.teavm.idea.jps.model.TeaVMJpsConfiguration;
+
+public class TeaVMBuilder extends ModuleLevelBuilder {
+ public TeaVMBuilder() {
+ super(BuilderCategory.CLASS_POST_PROCESSOR);
+ }
+
+ @Override
+ public ExitCode build(CompileContext context, ModuleChunk chunk,
+ DirtyFilesHolder dirtyFilesHolder,
+ OutputConsumer outputConsumer) throws ProjectBuildException, IOException {
+ for (JpsModule module : chunk.getModules()) {
+ buildModule(module);
+ }
+ return ExitCode.OK;
+ }
+
+ private void buildModule(JpsModule module) {
+ TeaVMJpsConfiguration config = TeaVMJpsConfiguration.get(module);
+ if (config == null || !config.isEnabled()) {
+ return;
+ }
+ Set classPathEntries = new HashSet<>();
+ buildClassPath(module, new HashSet<>(), classPathEntries);
+ System.out.println(classPathEntries.stream().collect(Collectors.joining(":")));
+ }
+
+ private void buildClassPath(JpsModule module, Set visited, Set classPathEntries) {
+ if (!visited.add(module)) {
+ return;
+ }
+ File output = JpsJavaExtensionService.getInstance().getOutputDirectory(module, false);
+ if (output != null) {
+ classPathEntries.add(output.getPath());
+ }
+ for (JpsDependencyElement dependency : module.getDependenciesList().getDependencies()) {
+ if (dependency instanceof JpsModuleDependency) {
+ buildClassPath(((JpsModuleDependency) dependency).getModule(), visited, classPathEntries);
+ } else if (dependency instanceof JpsLibraryDependency) {
+ JpsLibrary library = ((JpsLibraryDependency) dependency).getLibrary();
+ if (library == null) {
+ continue;
+ }
+ classPathEntries.addAll(library.getFiles(JpsOrderRootType.COMPILED).stream().map(File::getPath)
+ .collect(Collectors.toList()));
+ }
+ }
+ }
+
+ @NotNull
+ @Override
+ public String getPresentableName() {
+ return "TeaVM builder";
+ }
+}
diff --git a/tools/idea/src/main/java/org/teavm/idea/TeaVMBuilderService.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilderService.java
similarity index 74%
rename from tools/idea/src/main/java/org/teavm/idea/TeaVMBuilderService.java
rename to tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilderService.java
index 40b0f98f6..4a8947374 100644
--- a/tools/idea/src/main/java/org/teavm/idea/TeaVMBuilderService.java
+++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/TeaVMBuilderService.java
@@ -13,30 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.teavm.idea;
+package org.teavm.idea.jps;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.jps.builders.BuildTargetType;
-import org.jetbrains.jps.incremental.BuilderCategory;
import org.jetbrains.jps.incremental.BuilderService;
import org.jetbrains.jps.incremental.ModuleLevelBuilder;
+import org.jetbrains.jps.incremental.TargetBuilder;
public class TeaVMBuilderService extends BuilderService {
- TeaVMBuilderService() {
+ public TeaVMBuilderService() {
System.out.println("Hello");
}
@NotNull
@Override
- public List extends BuildTargetType>> getTargetTypes() {
- return Arrays.asList(TeaVMBuildTargetType.INSTANCE);
+ public List extends ModuleLevelBuilder> createModuleLevelBuilders() {
+ return Arrays.asList(new TeaVMBuilder());
}
@NotNull
@Override
- public List extends ModuleLevelBuilder> createModuleLevelBuilders() {
- return Arrays.asList(new TeaVMBuilder(BuilderCategory.CLASS_POST_PROCESSOR));
+ public List extends TargetBuilder, ?>> createBuilders() {
+ return Collections.emptyList();
}
}
diff --git a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/model/TeaVMJpsConfiguration.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/model/TeaVMJpsConfiguration.java
new file mode 100644
index 000000000..457ff0d80
--- /dev/null
+++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/model/TeaVMJpsConfiguration.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2016 Alexey Andreev.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.teavm.idea.jps.model;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.jps.model.JpsElementChildRole;
+import org.jetbrains.jps.model.ex.JpsElementBase;
+import org.jetbrains.jps.model.ex.JpsElementChildRoleBase;
+import org.jetbrains.jps.model.module.JpsModule;
+
+public class TeaVMJpsConfiguration extends JpsElementBase {
+ public static final JpsElementChildRole ROLE = JpsElementChildRoleBase.create(
+ "TeaVM configuration");
+ private boolean enabled;
+ private String mainClass;
+ private String targetDirectory;
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public String getMainClass() {
+ return mainClass;
+ }
+
+ public void setMainClass(String mainClass) {
+ this.mainClass = mainClass;
+ }
+
+ public String getTargetDirectory() {
+ return targetDirectory;
+ }
+
+ public void setTargetDirectory(String targetDirectory) {
+ this.targetDirectory = targetDirectory;
+ }
+
+ public static TeaVMJpsConfiguration get(JpsModule module) {
+ return module.getContainer().getChild(ROLE);
+ }
+
+ public void setTo(JpsModule module) {
+ module.getContainer().setChild(ROLE, this);
+ }
+
+ @NotNull
+ @Override
+ public TeaVMJpsConfiguration createCopy() {
+ TeaVMJpsConfiguration copy = new TeaVMJpsConfiguration();
+ copy.applyChanges(this);
+ return copy;
+ }
+
+ @Override
+ public void applyChanges(@NotNull TeaVMJpsConfiguration modified) {
+ enabled = modified.enabled;
+ mainClass = modified.mainClass;
+ targetDirectory = modified.targetDirectory;
+ }
+}
diff --git a/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/model/TeaVMModelSerializerService.java b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/model/TeaVMModelSerializerService.java
new file mode 100644
index 000000000..2e870db97
--- /dev/null
+++ b/tools/idea/jps-plugin/src/main/java/org/teavm/idea/jps/model/TeaVMModelSerializerService.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016 Alexey Andreev.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.teavm.idea.jps.model;
+
+import com.intellij.util.xmlb.XmlSerializer;
+import java.util.Objects;
+import org.jdom.Element;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.jps.model.module.JpsModule;
+import org.jetbrains.jps.model.serialization.JpsModelSerializerExtension;
+
+public class TeaVMModelSerializerService extends JpsModelSerializerExtension {
+ @Override
+ public void loadModuleOptions(@NotNull JpsModule module, @NotNull Element rootElement) {
+ rootElement.getChildren("component").stream()
+ .filter(child -> Objects.equals(child.getAttributeValue("name"), "teavm"))
+ .forEach(child -> readConfig(module, child));
+ }
+
+ private void readConfig(@NotNull JpsModule module, @NotNull Element element) {
+ TeaVMJpsConfiguration config = XmlSerializer.deserialize(element, TeaVMJpsConfiguration.class);
+ assert config != null;
+ config.setTo(module);
+ }
+}
diff --git a/tools/idea/jps-plugin/src/main/resources/META-INF/services/org.jetbrains.jps.incremental.BuilderService b/tools/idea/jps-plugin/src/main/resources/META-INF/services/org.jetbrains.jps.incremental.BuilderService
new file mode 100644
index 000000000..bd0f40b5d
--- /dev/null
+++ b/tools/idea/jps-plugin/src/main/resources/META-INF/services/org.jetbrains.jps.incremental.BuilderService
@@ -0,0 +1 @@
+org.teavm.idea.jps.TeaVMBuilderService
\ No newline at end of file
diff --git a/tools/idea/jps-plugin/src/main/resources/META-INF/services/org.jetbrains.jps.model.serialization.JpsModelSerializerExtension b/tools/idea/jps-plugin/src/main/resources/META-INF/services/org.jetbrains.jps.model.serialization.JpsModelSerializerExtension
new file mode 100644
index 000000000..cebf52ebf
--- /dev/null
+++ b/tools/idea/jps-plugin/src/main/resources/META-INF/services/org.jetbrains.jps.model.serialization.JpsModelSerializerExtension
@@ -0,0 +1 @@
+org.teavm.idea.jps.model.TeaVMModelSerializerService
\ No newline at end of file
diff --git a/tools/idea/jps-plugin/teavm-jps-plugin.iml b/tools/idea/jps-plugin/teavm-jps-plugin.iml
new file mode 100644
index 000000000..1bdcf56fe
--- /dev/null
+++ b/tools/idea/jps-plugin/teavm-jps-plugin.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tools/idea/src/main/java/org/teavm/idea/TeaVMBuildTarget.java b/tools/idea/src/main/java/org/teavm/idea/TeaVMBuildTarget.java
deleted file mode 100644
index 21a307be4..000000000
--- a/tools/idea/src/main/java/org/teavm/idea/TeaVMBuildTarget.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2016 Alexey Andreev.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.teavm.idea;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.jps.builders.BuildRootIndex;
-import org.jetbrains.jps.builders.BuildTarget;
-import org.jetbrains.jps.builders.BuildTargetRegistry;
-import org.jetbrains.jps.builders.ModuleBasedTarget;
-import org.jetbrains.jps.builders.TargetOutputIndex;
-import org.jetbrains.jps.builders.storage.BuildDataPaths;
-import org.jetbrains.jps.incremental.CompileContext;
-import org.jetbrains.jps.incremental.artifacts.instructions.ArtifactRootDescriptor;
-import org.jetbrains.jps.indices.IgnoredFileIndex;
-import org.jetbrains.jps.indices.ModuleExcludeIndex;
-import org.jetbrains.jps.model.JpsModel;
-import org.jetbrains.jps.model.module.JpsModule;
-
-public class TeaVMBuildTarget extends ModuleBasedTarget {
- TeaVMBuildTarget(TeaVMBuildTargetType targetType, @NotNull JpsModule module) {
- super(targetType, module);
- }
-
- @Override
- public boolean isTests() {
- return false;
- }
-
- @Override
- public String getId() {
- return getModule().getName() + "_teavm";
- }
-
- @Override
- public Collection> computeDependencies(BuildTargetRegistry targetRegistry,
- TargetOutputIndex outputIndex) {
- return Collections.emptyList();
- }
-
- @NotNull
- @Override
- public List computeRootDescriptors(JpsModel model, ModuleExcludeIndex index,
- IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
- return Collections.emptyList();
- }
-
- @Nullable
- @Override
- public ArtifactRootDescriptor findRootDescriptor(String rootId, BuildRootIndex rootIndex) {
- return null;
- }
-
- @NotNull
- @Override
- public String getPresentableName() {
- return getModule().getName() + " (TeaVM)";
- }
-
- @NotNull
- @Override
- public Collection getOutputRoots(CompileContext context) {
- TeaVMModuleExtension extension = getModule().getContainer().getChild(TeaVMModuleExtension.ROLE);
- if (extension == null) {
- return Collections.emptyList();
- }
- return Arrays.asList(new File(extension.getTargetDirectory()));
- }
-}
diff --git a/tools/idea/src/main/java/org/teavm/idea/TeaVMBuildTargetType.java b/tools/idea/src/main/java/org/teavm/idea/TeaVMBuildTargetType.java
deleted file mode 100644
index f3b1c7510..000000000
--- a/tools/idea/src/main/java/org/teavm/idea/TeaVMBuildTargetType.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2016 Alexey Andreev.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.teavm.idea;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.jps.builders.BuildTargetLoader;
-import org.jetbrains.jps.builders.ModuleBasedBuildTargetType;
-import org.jetbrains.jps.incremental.ModuleBuildTarget;
-import org.jetbrains.jps.model.JpsModel;
-import org.jetbrains.jps.model.module.JpsModule;
-
-public class TeaVMBuildTargetType extends ModuleBasedBuildTargetType {
- public static final TeaVMBuildTargetType INSTANCE = new TeaVMBuildTargetType("teavm");
-
- public TeaVMBuildTargetType(String typeId) {
- super(typeId);
- }
-
- @NotNull
- @Override
- public List computeAllTargets(@NotNull JpsModel model) {
- List modules = model.getProject().getModules();
- List targets = new ArrayList<>(modules.size());
- for (JpsModule module : modules) {
- if (module.getContainer().getChild(TeaVMModuleExtension.ROLE) != null) {
- targets.add(new TeaVMBuildTarget(this, module));
- }
- }
- return targets;
- }
-
- @NotNull
- @Override
- public BuildTargetLoader createLoader(@NotNull JpsModel model) {
- return null;
- }
-}
diff --git a/tools/idea/src/main/java/org/teavm/idea/TeaVMBuilder.java b/tools/idea/src/main/java/org/teavm/idea/TeaVMBuilder.java
deleted file mode 100644
index 6c75b17f5..000000000
--- a/tools/idea/src/main/java/org/teavm/idea/TeaVMBuilder.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2016 Alexey Andreev.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.teavm.idea;
-
-import java.io.IOException;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.jps.ModuleChunk;
-import org.jetbrains.jps.builders.DirtyFilesHolder;
-import org.jetbrains.jps.builders.java.JavaSourceRootDescriptor;
-import org.jetbrains.jps.incremental.BuilderCategory;
-import org.jetbrains.jps.incremental.CompileContext;
-import org.jetbrains.jps.incremental.ModuleBuildTarget;
-import org.jetbrains.jps.incremental.ModuleLevelBuilder;
-import org.jetbrains.jps.incremental.ProjectBuildException;
-
-public class TeaVMBuilder extends ModuleLevelBuilder {
- public TeaVMBuilder(BuilderCategory category) {
- super(category);
- }
-
- @Override
- public ExitCode build(CompileContext context, ModuleChunk chunk,
- DirtyFilesHolder dirtyFilesHolder,
- OutputConsumer outputConsumer) throws ProjectBuildException, IOException {
- return ExitCode.OK;
- }
-
- @NotNull
- @Override
- public String getPresentableName() {
- return "TeaVM builder";
- }
-}
diff --git a/tools/idea/src/main/java/org/teavm/idea/TeaVMModuleExtension.java b/tools/idea/src/main/java/org/teavm/idea/TeaVMModuleExtension.java
deleted file mode 100644
index b60b0db48..000000000
--- a/tools/idea/src/main/java/org/teavm/idea/TeaVMModuleExtension.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2016 Alexey Andreev.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.teavm.idea;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.jps.model.JpsElementChildRole;
-import org.jetbrains.jps.model.ex.JpsCompositeElementBase;
-import org.jetbrains.jps.model.ex.JpsElementChildRoleBase;
-
-public class TeaVMModuleExtension extends JpsCompositeElementBase {
- public static final JpsElementChildRole ROLE = JpsElementChildRoleBase
- .create("TeaVM configuration");
- private String mainClass;
- private String targetDirectory;
-
- public TeaVMModuleExtension(@NotNull String mainClass, @NotNull String targetDirectory) {
- this.mainClass = mainClass;
- this.targetDirectory = targetDirectory;
- }
-
- public TeaVMModuleExtension(TeaVMModuleExtension original) {
- super(original);
- mainClass = original.mainClass;
- targetDirectory = original.targetDirectory;
- }
-
- @NotNull
- public String getMainClass() {
- return mainClass;
- }
-
- public void setMainClass(@NotNull String mainClass) {
- this.mainClass = mainClass;
- }
-
- @NotNull
- public String getTargetDirectory() {
- return targetDirectory;
- }
-
- public void setTargetDirectory(@NotNull String targetDirectory) {
- this.targetDirectory = targetDirectory;
- }
-
- @NotNull
- @Override
- public TeaVMModuleExtension createCopy() {
- return new TeaVMModuleExtension(this);
- }
-}
diff --git a/tools/idea/src/main/java/org/teavm/idea/ui/TeaVMConfigurationPanel.java b/tools/idea/src/main/java/org/teavm/idea/ui/TeaVMConfigurationPanel.java
index 096677dba..a4f9b6f5a 100644
--- a/tools/idea/src/main/java/org/teavm/idea/ui/TeaVMConfigurationPanel.java
+++ b/tools/idea/src/main/java/org/teavm/idea/ui/TeaVMConfigurationPanel.java
@@ -58,15 +58,21 @@ class TeaVMConfigurationPanel extends JPanel {
constraints.gridwidth = GridBagConstraints.REMAINDER;
add(enabledCheckBox, constraints);
- constraints.gridwidth = GridBagConstraints.RELATIVE;
- add(new JLabel("Main class:"), constraints);
- constraints.gridwidth = GridBagConstraints.REMAINDER;
- add(mainClassField, constraints);
+ GridBagConstraints labelConstrains = new GridBagConstraints();
+ labelConstrains.gridwidth = GridBagConstraints.RELATIVE;
+ labelConstrains.anchor = GridBagConstraints.BASELINE_TRAILING;
- constraints.gridwidth = GridBagConstraints.RELATIVE;
- add(new JLabel("Target directory:"), constraints);
- constraints.gridwidth = GridBagConstraints.REMAINDER;
- add(targetDirectoryField, constraints);
+ GridBagConstraints fieldConstrains = new GridBagConstraints();
+ fieldConstrains.gridwidth = GridBagConstraints.REMAINDER;
+ fieldConstrains.fill = GridBagConstraints.HORIZONTAL;
+ labelConstrains.anchor = GridBagConstraints.BASELINE_LEADING;
+ labelConstrains.insets.right = 5;
+
+ add(new JLabel("Main class:"), labelConstrains);
+ add(mainClassField, fieldConstrains);
+
+ add(new JLabel("Target directory:"), labelConstrains);
+ add(targetDirectoryField, fieldConstrains);
}
public void load(TeaVMConfiguration config) {
diff --git a/tools/idea/src/main/resources/META-INF/plugin.xml b/tools/idea/src/main/resources/META-INF/plugin.xml
index 82d6ef691..a5ffd49d2 100644
--- a/tools/idea/src/main/resources/META-INF/plugin.xml
+++ b/tools/idea/src/main/resources/META-INF/plugin.xml
@@ -1,8 +1,8 @@
- com.your.company.unique.plugin.id
- Plugin display name here
+ org.teavm.idea
+ TeaVM IDEA plugin
1.0
- YourCompany
+ TeaVM community
@@ -21,11 +21,9 @@
+
-
-
-
org.teavm.idea.TeaVMConfigurationStorage
diff --git a/tools/idea/src/main/resources/META-INF/services/org.jetbrains.jps.incremental.BuilderService b/tools/idea/src/main/resources/META-INF/services/org.jetbrains.jps.incremental.BuilderService
deleted file mode 100644
index f1072fdb7..000000000
--- a/tools/idea/src/main/resources/META-INF/services/org.jetbrains.jps.incremental.BuilderService
+++ /dev/null
@@ -1 +0,0 @@
-org.teavm.idea.TeaVMBuilderService
\ No newline at end of file
diff --git a/tools/idea/teavm-idea-plugin.iml b/tools/idea/teavm-idea-plugin.iml
index eacb55867..ea0f494f2 100644
--- a/tools/idea/teavm-idea-plugin.iml
+++ b/tools/idea/teavm-idea-plugin.iml
@@ -1,13 +1,17 @@
-
+
+
+
+
+
\ No newline at end of file