mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Gradle: introduce gradle-tooling-extensions modules with respective classpath; expose scala project configuration for ProjectDataService usage
related issues: * IDEA-119755 Integration between IJ13 & Gradle newer than from Jan 7, 2014 is broken * IDEA-91901 Add extension point for Gradle to add possibility to change project files on Gradle project importing
This commit is contained in:
@@ -329,6 +329,15 @@ public def layoutCommunityPlugins(String home) {
|
||||
jar("gradle.jar") {
|
||||
module("gradle")
|
||||
}
|
||||
jar("gradle-tooling-extension.jar") {
|
||||
module("gradle-tooling-extension")
|
||||
}
|
||||
jar("gradle-tooling-extension-v1.9.jar") {
|
||||
module("gradle-tooling-extension-v1.9")
|
||||
}
|
||||
jar("gradle-tooling-extension-v1.11.jar") {
|
||||
module("gradle-tooling-extension-v1.11")
|
||||
}
|
||||
fileset(dir: "$home/plugins/gradle/lib") { include(name: "*.jar") }
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="annotations" exported="" />
|
||||
<orderEntry type="module" module-name="util" exported="" />
|
||||
<orderEntry type="module" module-name="projectModel-api" exported="" />
|
||||
<orderEntry type="module" module-name="platform-api" exported="" />
|
||||
<orderEntry type="module" module-name="lang-api" exported="" />
|
||||
<orderEntry type="module" module-name="util" />
|
||||
<orderEntry type="module" module-name="projectModel-api" />
|
||||
<orderEntry type="module" module-name="platform-api" />
|
||||
<orderEntry type="module" module-name="lang-api" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
+10
-84
@@ -9,8 +9,10 @@
|
||||
<sourceFolder url="file://$MODULE_DIR$/testData" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="library" scope="TEST" name="Mocks" level="project" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="external-system-api" exported="" />
|
||||
<orderEntry type="module" module-name="external-system-impl" exported="" />
|
||||
<orderEntry type="module" module-name="gradle-tooling-extension" exported="" />
|
||||
<orderEntry type="module" module-name="idea-ui" />
|
||||
<orderEntry type="module" module-name="lang-api" />
|
||||
<orderEntry type="module" module-name="compiler-openapi" />
|
||||
@@ -20,108 +22,32 @@
|
||||
<orderEntry type="module" module-name="execution-openapi" />
|
||||
<orderEntry type="module" module-name="openapi" />
|
||||
<orderEntry type="module" module-name="java-impl" />
|
||||
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="maven" />
|
||||
<orderEntry type="library" name="swingx" level="project" />
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library name="Gradle">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-base-services-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-tooling-api-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-core-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-messaging-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-tooling-api-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-wrapper-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-plugins-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-build-init-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-base-services-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-native-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-ide-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-reporting-1.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/buildSrc/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/buildSrc/src/test/resources" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cli/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cpp/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cpp/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ear/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ide/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ide/src/main/resources" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java/org/gradle/api/publish/ivy/tasks" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java/org/gradle/api/publish/ivy/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/osgi/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/osgi/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/antlr/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/jetty/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/maven/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/maven/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/scala/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/scala/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/jacoco/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/native/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/publish/src/main/groovy/org/gradle/api/publish/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/publish/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/wrapper/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/wrapper/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/announce/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/open-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/open-api/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core-impl/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core-impl/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/messaging/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/messaging/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/reporting/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/resources/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/javascript/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/testjar/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/testjar/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-impl/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-impl/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/singleModule/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/singleModule/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/enforcerplugin/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-impl/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-impl/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/performance/src/configPlugin" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/performance/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/code-quality/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy/org/gradle/language/jvm/tasks" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy/org/gradle/language/jvm/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-base/src/main/groovy/org/gradle/language/base/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-base/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/integTest/resources/org/gradle/api/plugins/buildcomparison/gradle/BuildComparisonIntegrationSpec/compareArchives/source/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/integTest/resources/org/gradle/api/plugins/buildcomparison/gradle/BuildComparisonIntegrationSpec/compareArchives/target/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/internal-testing/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services-groovy/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services-groovy/src/test/groovy" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
@@ -164,9 +90,7 @@
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module" module-name="external-system-impl" />
|
||||
<orderEntry type="module" module-name="external-system-api" />
|
||||
<orderEntry type="module-library" exported="">
|
||||
<orderEntry type="module-library">
|
||||
<library name="GradleJnaPosix">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jna-3.2.7.jar!/" />
|
||||
@@ -187,8 +111,10 @@
|
||||
<jarDirectory url="jar://$MODULE_DIR$/lib/native-platform-windows-i386-0.3-rc-2.jar!/" recursive="false" />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" scope="TEST" name="Mocks" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="testFramework-java" scope="TEST" />
|
||||
<orderEntry type="module" module-name="maven" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
||||
<projectResolve implementation="org.jetbrains.plugins.gradle.integrations.scala.ScalaGradleProjectResolverExtension"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
@@ -24,6 +24,7 @@
|
||||
<depends>org.intellij.groovy</depends>
|
||||
<depends optional="true" config-file="gradle-javaee-plugin.xml">com.intellij.javaee</depends>
|
||||
<depends optional="true" config-file="gradle-maven-integration.xml">org.jetbrains.idea.maven</depends>
|
||||
<depends optional="true" config-file="gradle-scala-integration.xml">org.intellij.scala</depends>
|
||||
|
||||
<extensionPoints>
|
||||
<extensionPoint name="projectResolve" interface="org.jetbrains.plugins.gradle.service.project.GradleProjectResolverExtension"/>
|
||||
|
||||
+2
-2
@@ -20,7 +20,6 @@ import com.intellij.openapi.externalSystem.model.DataNode;
|
||||
import com.intellij.openapi.externalSystem.model.project.ModuleData;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemConstants;
|
||||
import com.intellij.openapi.externalSystem.util.Order;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.gradle.tooling.model.idea.IdeaModule;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.gradle.model.WarModel;
|
||||
@@ -28,6 +27,7 @@ import org.jetbrains.plugins.gradle.model.data.WarModelData;
|
||||
import org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension;
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -58,6 +58,6 @@ public class JavaEEGradleProjectResolverExtension extends AbstractProjectResolve
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<Class> getExtraProjectModelClasses() {
|
||||
return ContainerUtil.<Class>set(WarModel.class);
|
||||
return Collections.<Class>singleton(WarModel.class);
|
||||
}
|
||||
}
|
||||
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.integrations.scala;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.externalSystem.model.DataNode;
|
||||
import com.intellij.openapi.externalSystem.model.project.ModuleData;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemConstants;
|
||||
import com.intellij.openapi.externalSystem.util.Order;
|
||||
import org.gradle.tooling.model.idea.IdeaModule;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.ScalaCompileOptions;
|
||||
import org.jetbrains.plugins.gradle.model.ScalaForkOptions;
|
||||
import org.jetbrains.plugins.gradle.model.ScalaModel;
|
||||
import org.jetbrains.plugins.gradle.model.data.ScalaCompileOptionsData;
|
||||
import org.jetbrains.plugins.gradle.model.data.ScalaModelData;
|
||||
import org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension;
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
@Order(ExternalSystemConstants.UNORDERED)
|
||||
public class ScalaGradleProjectResolverExtension extends AbstractProjectResolverExtension {
|
||||
private static final Logger LOG = Logger.getInstance(ScalaGradleProjectResolverExtension.class);
|
||||
|
||||
@Override
|
||||
public void populateModuleExtraModels(@NotNull IdeaModule gradleModule, @NotNull DataNode<ModuleData> ideModule) {
|
||||
ScalaModel scalaModel = resolverCtx.getExtraProject(gradleModule, ScalaModel.class);
|
||||
if (scalaModel != null) {
|
||||
ScalaModelData scalaModelData = create(scalaModel);
|
||||
ideModule.createChild(ScalaModelData.KEY, scalaModelData);
|
||||
}
|
||||
|
||||
nextResolver.populateModuleExtraModels(gradleModule, ideModule);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<Class> getExtraProjectModelClasses() {
|
||||
return Collections.<Class>singleton(ScalaModel.class);
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
private static ScalaModelData create(@NotNull ScalaModel scalaModel) {
|
||||
ScalaModelData scalaModelData = new ScalaModelData(GradleConstants.SYSTEM_ID);
|
||||
scalaModelData.setZincClasspath(scalaModel.getZincClasspath());
|
||||
scalaModelData.setScalaClasspath(scalaModel.getScalaClasspath());
|
||||
scalaModelData.setScalaCompileOptions(create((scalaModel.getScalaCompileOptions())));
|
||||
scalaModelData.setSourceCompatibility(scalaModel.getSourceCompatibility());
|
||||
scalaModelData.setTargetCompatibility(scalaModel.getTargetCompatibility());
|
||||
return scalaModelData;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Contract("null -> null")
|
||||
private static ScalaCompileOptionsData create(@Nullable ScalaCompileOptions options) {
|
||||
if (options == null) return null;
|
||||
|
||||
ScalaCompileOptionsData result = new ScalaCompileOptionsData();
|
||||
|
||||
result.setAdditionalParameters(options.getAdditionalParameters());
|
||||
result.setDaemonServer(options.getDaemonServer());
|
||||
result.setDebugLevel(options.getDebugLevel());
|
||||
result.setDeprecation(options.isDeprecation());
|
||||
result.setEncoding(options.getEncoding());
|
||||
result.setFailOnError(options.isFailOnError());
|
||||
result.setForce(options.getForce());
|
||||
result.setFork(options.isFork());
|
||||
result.setListFiles(options.isListFiles());
|
||||
result.setLoggingLevel(options.getLoggingLevel());
|
||||
result.setDebugLevel(options.getDebugLevel());
|
||||
result.setLoggingPhases(options.getLoggingPhases());
|
||||
result.setOptimize(options.isOptimize());
|
||||
result.setUnchecked(options.isUnchecked());
|
||||
result.setUseAnt(options.isUseAnt());
|
||||
result.setUseCompileDaemon(options.isUseCompileDaemon());
|
||||
result.setForkOptions(create(options.getForkOptions()));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Contract("null -> null")
|
||||
private static ScalaCompileOptionsData.ScalaForkOptions create(@Nullable ScalaForkOptions options) {
|
||||
if (options == null) return null;
|
||||
|
||||
ScalaCompileOptionsData.ScalaForkOptions result = new ScalaCompileOptionsData.ScalaForkOptions();
|
||||
result.setJvmArgs(options.getJvmArgs());
|
||||
result.setMemoryInitialSize(options.getMemoryInitialSize());
|
||||
result.setMemoryMaximumSize(options.getMemoryMaximumSize());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+61
@@ -19,8 +19,12 @@ import com.intellij.openapi.externalSystem.model.Key;
|
||||
import com.intellij.openapi.externalSystem.model.ProjectKeys;
|
||||
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
|
||||
import com.intellij.openapi.externalSystem.model.project.AbstractExternalEntityData;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -46,4 +50,61 @@ public class BuildScriptClasspathData extends AbstractExternalEntityData {
|
||||
public List<ClasspathEntry> getClasspathEntries() {
|
||||
return myClasspathEntries;
|
||||
}
|
||||
|
||||
public static class ClasspathEntry implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull
|
||||
private final File myClassesFile;
|
||||
|
||||
@Nullable
|
||||
private final File mySourcesFile;
|
||||
|
||||
@Nullable
|
||||
private final File myJavadocFile;
|
||||
|
||||
public ClasspathEntry(@NotNull File classesFile, @Nullable File sourcesFile, @Nullable File javadocFile) {
|
||||
myClassesFile = classesFile;
|
||||
mySourcesFile = sourcesFile;
|
||||
myJavadocFile = javadocFile;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public File getClassesFile() {
|
||||
return myClassesFile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public File getSourcesFile() {
|
||||
return mySourcesFile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public File getJavadocFile() {
|
||||
return myJavadocFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ClasspathEntry)) return false;
|
||||
|
||||
ClasspathEntry entry = (ClasspathEntry)o;
|
||||
|
||||
if (!FileUtil.filesEqual(myClassesFile, entry.myClassesFile)) return false;
|
||||
if (!FileUtil.filesEqual(myJavadocFile, entry.myJavadocFile)) return false;
|
||||
if (!FileUtil.filesEqual(mySourcesFile, entry.mySourcesFile)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = FileUtil.fileHashCode(myClassesFile);
|
||||
result = 31 * result + FileUtil.fileHashCode(mySourcesFile);
|
||||
result = 31 * result + FileUtil.fileHashCode(myJavadocFile);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.model.data;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 12/23/13
|
||||
*/
|
||||
public class ClasspathEntry implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull
|
||||
private final File myClassesFile;
|
||||
|
||||
@Nullable
|
||||
private final File mySourcesFile;
|
||||
|
||||
@Nullable
|
||||
private final File myJavadocFile;
|
||||
|
||||
public ClasspathEntry(@NotNull File classesFile, @Nullable File sourcesFile, @Nullable File javadocFile) {
|
||||
myClassesFile = classesFile;
|
||||
mySourcesFile = sourcesFile;
|
||||
myJavadocFile = javadocFile;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public File getClassesFile() {
|
||||
return myClassesFile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public File getSourcesFile() {
|
||||
return mySourcesFile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public File getJavadocFile() {
|
||||
return myJavadocFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ClasspathEntry)) return false;
|
||||
|
||||
ClasspathEntry entry = (ClasspathEntry)o;
|
||||
|
||||
if (!FileUtil.filesEqual(myClassesFile, entry.myClassesFile)) return false;
|
||||
if (!FileUtil.filesEqual(myJavadocFile, entry.myJavadocFile)) return false;
|
||||
if (!FileUtil.filesEqual(mySourcesFile, entry.mySourcesFile)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = FileUtil.fileHashCode(myClassesFile);
|
||||
result = 31 * result + FileUtil.fileHashCode(mySourcesFile);
|
||||
result = 31 * result + FileUtil.fileHashCode(myJavadocFile);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.model.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public class ScalaCompileOptionsData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private boolean useCompileDaemon;
|
||||
private String daemonServer;
|
||||
private boolean failOnError;
|
||||
private boolean deprecation;
|
||||
private boolean unchecked;
|
||||
private String debugLevel;
|
||||
private boolean optimize;
|
||||
private String encoding;
|
||||
private String force;
|
||||
private String targetCompatibility;
|
||||
private List<String> additionalParameters;
|
||||
private boolean listFiles;
|
||||
private String loggingLevel;
|
||||
private List<String> loggingPhases;
|
||||
private boolean fork;
|
||||
private ScalaForkOptions forkOptions;
|
||||
private boolean useAnt;
|
||||
|
||||
public boolean isUseCompileDaemon() {
|
||||
return useCompileDaemon;
|
||||
}
|
||||
|
||||
public void setUseCompileDaemon(boolean useCompileDaemon) {
|
||||
this.useCompileDaemon = useCompileDaemon;
|
||||
}
|
||||
|
||||
public String getDaemonServer() {
|
||||
return daemonServer;
|
||||
}
|
||||
|
||||
public void setDaemonServer(String daemonServer) {
|
||||
this.daemonServer = daemonServer;
|
||||
}
|
||||
|
||||
public boolean isFailOnError() {
|
||||
return failOnError;
|
||||
}
|
||||
|
||||
public void setFailOnError(boolean failOnError) {
|
||||
this.failOnError = failOnError;
|
||||
}
|
||||
|
||||
public boolean isDeprecation() {
|
||||
return deprecation;
|
||||
}
|
||||
|
||||
public void setDeprecation(boolean deprecation) {
|
||||
this.deprecation = deprecation;
|
||||
}
|
||||
|
||||
public boolean isUnchecked() {
|
||||
return unchecked;
|
||||
}
|
||||
|
||||
public void setUnchecked(boolean unchecked) {
|
||||
this.unchecked = unchecked;
|
||||
}
|
||||
|
||||
public String getDebugLevel() {
|
||||
return debugLevel;
|
||||
}
|
||||
|
||||
public void setDebugLevel(String debugLevel) {
|
||||
this.debugLevel = debugLevel;
|
||||
}
|
||||
|
||||
public boolean isOptimize() {
|
||||
return optimize;
|
||||
}
|
||||
|
||||
public void setOptimize(boolean optimize) {
|
||||
this.optimize = optimize;
|
||||
}
|
||||
|
||||
public String getEncoding() {
|
||||
return encoding;
|
||||
}
|
||||
|
||||
public void setEncoding(String encoding) {
|
||||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
public String getForce() {
|
||||
return force;
|
||||
}
|
||||
|
||||
public void setForce(String force) {
|
||||
this.force = force;
|
||||
}
|
||||
|
||||
public String getTargetCompatibility() {
|
||||
return targetCompatibility;
|
||||
}
|
||||
|
||||
public void setTargetCompatibility(String targetCompatibility) {
|
||||
this.targetCompatibility = targetCompatibility;
|
||||
}
|
||||
|
||||
public List<String> getAdditionalParameters() {
|
||||
return additionalParameters;
|
||||
}
|
||||
|
||||
public void setAdditionalParameters(List<String> additionalParameters) {
|
||||
this.additionalParameters = additionalParameters;
|
||||
}
|
||||
|
||||
public boolean isListFiles() {
|
||||
return listFiles;
|
||||
}
|
||||
|
||||
public void setListFiles(boolean listFiles) {
|
||||
this.listFiles = listFiles;
|
||||
}
|
||||
|
||||
public String getLoggingLevel() {
|
||||
return loggingLevel;
|
||||
}
|
||||
|
||||
public void setLoggingLevel(String loggingLevel) {
|
||||
this.loggingLevel = loggingLevel;
|
||||
}
|
||||
|
||||
public List<String> getLoggingPhases() {
|
||||
return loggingPhases;
|
||||
}
|
||||
|
||||
public void setLoggingPhases(List<String> loggingPhases) {
|
||||
this.loggingPhases = loggingPhases;
|
||||
}
|
||||
|
||||
public boolean isFork() {
|
||||
return fork;
|
||||
}
|
||||
|
||||
public void setFork(boolean fork) {
|
||||
this.fork = fork;
|
||||
}
|
||||
|
||||
public boolean isUseAnt() {
|
||||
return useAnt;
|
||||
}
|
||||
|
||||
public void setUseAnt(boolean useAnt) {
|
||||
this.useAnt = useAnt;
|
||||
}
|
||||
|
||||
public ScalaForkOptions getForkOptions() {
|
||||
return forkOptions;
|
||||
}
|
||||
|
||||
public void setForkOptions(ScalaForkOptions forkOptions) {
|
||||
this.forkOptions = forkOptions;
|
||||
}
|
||||
|
||||
public static class ScalaForkOptions implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String memoryInitialSize;
|
||||
private String memoryMaximumSize;
|
||||
private List<String> jvmArgs;
|
||||
|
||||
public String getMemoryInitialSize() {
|
||||
return memoryInitialSize;
|
||||
}
|
||||
|
||||
public void setMemoryInitialSize(String memoryInitialSize) {
|
||||
this.memoryInitialSize = memoryInitialSize;
|
||||
}
|
||||
|
||||
public String getMemoryMaximumSize() {
|
||||
return memoryMaximumSize;
|
||||
}
|
||||
|
||||
public void setMemoryMaximumSize(String memoryMaximumSize) {
|
||||
this.memoryMaximumSize = memoryMaximumSize;
|
||||
}
|
||||
|
||||
public List<String> getJvmArgs() {
|
||||
return jvmArgs;
|
||||
}
|
||||
|
||||
public void setJvmArgs(List<String> jvmArgs) {
|
||||
this.jvmArgs = jvmArgs;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.model.data;
|
||||
|
||||
import com.intellij.openapi.externalSystem.model.Key;
|
||||
import com.intellij.openapi.externalSystem.model.ProjectKeys;
|
||||
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
|
||||
import com.intellij.openapi.externalSystem.model.project.AbstractExternalEntityData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public class ScalaModelData extends AbstractExternalEntityData {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull
|
||||
public static final Key<ScalaModelData> KEY = Key.create(ScalaModelData.class, ProjectKeys.LIBRARY_DEPENDENCY.getProcessingWeight() + 1);
|
||||
private Set<File> scalaClasspath;
|
||||
private Set<File> zincClasspath;
|
||||
private ScalaCompileOptionsData scalaCompileOptions;
|
||||
private String sourceCompatibility;
|
||||
private String targetCompatibility;
|
||||
|
||||
|
||||
public ScalaModelData(@NotNull ProjectSystemId owner) {
|
||||
super(owner);
|
||||
}
|
||||
|
||||
public Set<File> getScalaClasspath() {
|
||||
return scalaClasspath;
|
||||
}
|
||||
|
||||
public void setScalaClasspath(Set<File> scalaClasspath) {
|
||||
this.scalaClasspath = scalaClasspath;
|
||||
}
|
||||
|
||||
public Set<File> getZincClasspath() {
|
||||
return zincClasspath;
|
||||
}
|
||||
|
||||
public void setZincClasspath(Set<File> zincClasspath) {
|
||||
this.zincClasspath = zincClasspath;
|
||||
}
|
||||
|
||||
public ScalaCompileOptionsData getScalaCompileOptions() {
|
||||
return scalaCompileOptions;
|
||||
}
|
||||
|
||||
public void setScalaCompileOptions(ScalaCompileOptionsData scalaCompileOptions) {
|
||||
this.scalaCompileOptions = scalaCompileOptions;
|
||||
}
|
||||
|
||||
public String getSourceCompatibility() {
|
||||
return sourceCompatibility;
|
||||
}
|
||||
|
||||
public void setSourceCompatibility(String sourceCompatibility) {
|
||||
this.sourceCompatibility = sourceCompatibility;
|
||||
}
|
||||
|
||||
public String getTargetCompatibility() {
|
||||
return targetCompatibility;
|
||||
}
|
||||
|
||||
public void setTargetCompatibility(String targetCompatibility) {
|
||||
this.targetCompatibility = targetCompatibility;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ScalaModelData)) return false;
|
||||
if (!super.equals(o)) return false;
|
||||
|
||||
ScalaModelData data = (ScalaModelData)o;
|
||||
|
||||
if (scalaClasspath != null ? !scalaClasspath.equals(data.scalaClasspath) : data.scalaClasspath != null) return false;
|
||||
if (scalaCompileOptions != null ? !scalaCompileOptions.equals(data.scalaCompileOptions) : data.scalaCompileOptions != null) {
|
||||
return false;
|
||||
}
|
||||
if (sourceCompatibility != null ? !sourceCompatibility.equals(data.sourceCompatibility) : data.sourceCompatibility != null) {
|
||||
return false;
|
||||
}
|
||||
if (targetCompatibility != null ? !targetCompatibility.equals(data.targetCompatibility) : data.targetCompatibility != null) {
|
||||
return false;
|
||||
}
|
||||
if (zincClasspath != null ? !zincClasspath.equals(data.zincClasspath) : data.zincClasspath != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = super.hashCode();
|
||||
result = 31 * result + (scalaClasspath != null ? scalaClasspath.hashCode() : 0);
|
||||
result = 31 * result + (zincClasspath != null ? zincClasspath.hashCode() : 0);
|
||||
result = 31 * result + (scalaCompileOptions != null ? scalaCompileOptions.hashCode() : 0);
|
||||
result = 31 * result + (sourceCompatibility != null ? sourceCompatibility.hashCode() : 0);
|
||||
result = 31 * result + (targetCompatibility != null ? targetCompatibility.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.model.internal;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.tooling.provider.model.ToolingModelBuilder;
|
||||
import org.jetbrains.plugins.gradle.model.ModelBuilderService;
|
||||
|
||||
import java.util.ServiceLoader;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/5/13
|
||||
*/
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public class ExtraModelBuilder implements ToolingModelBuilder {
|
||||
private static ServiceLoader<ModelBuilderService> buildersLoader =
|
||||
ServiceLoader.load(ModelBuilderService.class, ExtraModelBuilder.class.getClassLoader());
|
||||
|
||||
@Override
|
||||
public boolean canBuild(String modelName) {
|
||||
for (ModelBuilderService service : buildersLoader) {
|
||||
if (service.canBuild(modelName)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object buildAll(String modelName, Project project) {
|
||||
for (ModelBuilderService service : buildersLoader) {
|
||||
if (service.canBuild(modelName)) {
|
||||
return service.buildAll(modelName, project);
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unsupported model: " + modelName);
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -14,7 +14,6 @@ import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.ContainerUtilRt;
|
||||
import org.gradle.StartParameter;
|
||||
import org.gradle.api.tasks.wrapper.Wrapper;
|
||||
import org.gradle.util.DistributionLocator;
|
||||
import org.gradle.util.GradleVersion;
|
||||
import org.gradle.wrapper.PathAssembler;
|
||||
@@ -465,7 +464,7 @@ public class GradleInstallationManager {
|
||||
}
|
||||
File gradleSystemDir;
|
||||
|
||||
if (Wrapper.PathBase.PROJECT.name().equals(wrapperConfiguration.getDistributionBase())) {
|
||||
if ("PROJECT".equals(wrapperConfiguration.getDistributionBase())) {
|
||||
gradleSystemDir = new File(linkedProjectPath, ".gradle");
|
||||
}
|
||||
else {
|
||||
|
||||
+4
-6
@@ -15,10 +15,9 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.service.project;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.base.Strings;
|
||||
import com.intellij.openapi.externalSystem.model.ExternalSystemException;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.gradle.api.internal.LocationAwareException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -81,8 +80,8 @@ public abstract class AbstractProjectImportErrorHandler {
|
||||
String location = error.getMessage();
|
||||
if (location != null && location.startsWith("Build file '")) {
|
||||
// Only the first line contains the location of the error. Discard the rest.
|
||||
Iterable<String> lines = Splitter.on('\n').split(location);
|
||||
return lines.iterator().next();
|
||||
String[] lines = StringUtil.splitByLines(location);
|
||||
return lines.length > 0 ? lines[0] : null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -96,8 +95,7 @@ public abstract class AbstractProjectImportErrorHandler {
|
||||
newMsg = "Cause: " + newMsg;
|
||||
}
|
||||
|
||||
if (!Strings.isNullOrEmpty(location)) {
|
||||
assert location != null;
|
||||
if (!StringUtil.isEmpty(location)) {
|
||||
Matcher matcher = ERROR_LOCATION_PATTERN.matcher(location);
|
||||
if(matcher.find()) {
|
||||
String href = "error in file: " + matcher.group(1) + " at line: " + matcher.group(2);
|
||||
|
||||
+5
-5
@@ -55,7 +55,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.*;
|
||||
import org.jetbrains.plugins.gradle.model.data.BuildScriptClasspathData;
|
||||
import org.jetbrains.plugins.gradle.model.data.ClasspathEntry;
|
||||
import org.jetbrains.plugins.gradle.util.GradleBundle;
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants;
|
||||
import org.jetbrains.plugins.gradle.util.GradleUtil;
|
||||
@@ -156,11 +155,11 @@ public class BaseGradleProjectResolverExtension implements GradleProjectResolver
|
||||
public void populateModuleExtraModels(@NotNull IdeaModule gradleModule, @NotNull DataNode<ModuleData> ideModule) {
|
||||
BuildScriptClasspathModel buildScriptClasspathModel = resolverCtx.getExtraProject(gradleModule, BuildScriptClasspathModel.class);
|
||||
if (buildScriptClasspathModel != null) {
|
||||
List<ClasspathEntry> classpathEntries =
|
||||
ContainerUtil.map(buildScriptClasspathModel.getClasspath(), new Function<ClasspathEntryModel, ClasspathEntry>() {
|
||||
List<BuildScriptClasspathData.ClasspathEntry> classpathEntries =
|
||||
ContainerUtil.map(buildScriptClasspathModel.getClasspath(), new Function<ClasspathEntryModel, BuildScriptClasspathData.ClasspathEntry>() {
|
||||
@Override
|
||||
public ClasspathEntry fun(ClasspathEntryModel model) {
|
||||
return new ClasspathEntry(model.getClassesFile(), model.getSourcesFile(), model.getJavadocFile());
|
||||
public BuildScriptClasspathData.ClasspathEntry fun(ClasspathEntryModel model) {
|
||||
return new BuildScriptClasspathData.ClasspathEntry(model.getClassesFile(), model.getSourcesFile(), model.getJavadocFile());
|
||||
}
|
||||
});
|
||||
BuildScriptClasspathData buildScriptClasspathData =
|
||||
@@ -366,6 +365,7 @@ public class BaseGradleProjectResolverExtension implements GradleProjectResolver
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaModuleType.class));
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ModuleType.class));
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(EmptyModuleType.class));
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ProjectImportAction.class));
|
||||
for (String entry : additionalEntries) {
|
||||
classPath.add(entry);
|
||||
}
|
||||
|
||||
+1
-2
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.service.project;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.externalSystem.model.ExternalSystemException;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
@@ -54,7 +53,7 @@ public class BaseProjectImportErrorHandler extends AbstractProjectImportErrorHan
|
||||
Throwable rootCause = rootCauseAndLocation.getFirst();
|
||||
|
||||
String location = rootCauseAndLocation.getSecond();
|
||||
if (location == null && !Strings.isNullOrEmpty(buildFilePath)) {
|
||||
if (location == null && !StringUtil.isEmpty(buildFilePath)) {
|
||||
location = String.format("Build file: '%1$s'", buildFilePath);
|
||||
}
|
||||
|
||||
|
||||
+31
-9
@@ -35,6 +35,7 @@ import org.gradle.tooling.internal.consumer.Distribution;
|
||||
import org.gradle.tooling.model.build.BuildEnvironment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectImportAction;
|
||||
import org.jetbrains.plugins.gradle.settings.DistributionType;
|
||||
import org.jetbrains.plugins.gradle.settings.GradleExecutionSettings;
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants;
|
||||
@@ -45,9 +46,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
@@ -202,6 +201,7 @@ public class GradleExecutionHelper {
|
||||
return f.fun(connection);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
LOG.warn("Gradle execution error", e);
|
||||
Throwable rootCause = ExceptionUtil.getRootCause(e);
|
||||
throw new ExternalSystemException(ExceptionUtil.getMessage(rootCause));
|
||||
}
|
||||
@@ -378,16 +378,13 @@ public class GradleExecutionHelper {
|
||||
|
||||
@Nullable
|
||||
public static File generateInitScript(boolean isBuildSrcProject) {
|
||||
InputStream stream = GradleProjectResolver.class.getResourceAsStream("/org/jetbrains/plugins/gradle/model/internal/init.gradle");
|
||||
InputStream stream = ProjectImportAction.class.getResourceAsStream("/org/jetbrains/plugins/gradle/tooling/internal/init.gradle");
|
||||
try {
|
||||
if (stream == null) {
|
||||
LOG.warn("Can't get init script template");
|
||||
return null;
|
||||
}
|
||||
|
||||
String jarPath = PathUtil.getCanonicalPath(PathUtil.getJarPathForClass(GradleProjectResolver.class));
|
||||
String s = FileUtil.loadTextAndClose(stream).replace("${JAR_PATH}", jarPath);
|
||||
|
||||
String s = FileUtil.loadTextAndClose(stream).replace("${EXTENSIONS_JARS_PATH}", getToolingExtensionsJarPaths());
|
||||
if (isBuildSrcProject) {
|
||||
String buildSrcDefaultInitScript = getBuildSrcDefaultInitScript();
|
||||
if (buildSrcDefaultInitScript == null) return null;
|
||||
@@ -410,7 +407,7 @@ public class GradleExecutionHelper {
|
||||
@Nullable
|
||||
public static String getBuildSrcDefaultInitScript() {
|
||||
InputStream stream =
|
||||
GradleProjectResolver.class.getResourceAsStream("/org/jetbrains/plugins/gradle/model/internal/buildSrcInit.gradle");
|
||||
ProjectImportAction.class.getResourceAsStream("/org/jetbrains/plugins/gradle/tooling/internal/buildSrcInit.gradle");
|
||||
try {
|
||||
if (stream == null) return null;
|
||||
return FileUtil.loadTextAndClose(stream);
|
||||
@@ -434,4 +431,29 @@ public class GradleExecutionHelper {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String getToolingExtensionsJarPaths() throws ClassNotFoundException {
|
||||
final ArrayList<Class<?>> list = ContainerUtil.newArrayList(
|
||||
// add gradle-tooling-extension jar
|
||||
Class.forName("org.jetbrains.plugins.gradle.model.ProjectImportAction"),
|
||||
// add gradle-tooling-extension-v1.9 jar
|
||||
Class.forName("org.jetbrains.plugins.gradle.tooling.v1_9.builder.ModelBuildScriptClasspathBuilderImpl"),
|
||||
// add gradle-tooling-extension-v1.11 jar
|
||||
Class.forName("org.jetbrains.plugins.gradle.tooling.v1_11.builder.ModelBuildScriptClasspathBuilderImpl")
|
||||
);
|
||||
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append('[');
|
||||
for (Iterator<Class<?>> it = list.iterator(); it.hasNext(); ) {
|
||||
Class<?> aClass = it.next();
|
||||
String jarPath = PathUtil.getCanonicalPath(PathUtil.getJarPathForClass(aClass));
|
||||
buf.append('\"').append(jarPath).append('\"');
|
||||
if (it.hasNext()) {
|
||||
buf.append(',');
|
||||
}
|
||||
}
|
||||
buf.append(']');
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -47,6 +47,7 @@ import org.gradle.tooling.model.idea.IdeaModule;
|
||||
import org.gradle.tooling.model.idea.IdeaProject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectImportAction;
|
||||
import org.jetbrains.plugins.gradle.remote.impl.GradleLibraryNamesMixer;
|
||||
import org.jetbrains.plugins.gradle.settings.ClassHolder;
|
||||
import org.jetbrains.plugins.gradle.settings.GradleExecutionSettings;
|
||||
|
||||
+1
-3
@@ -26,12 +26,10 @@ import com.intellij.openapi.externalSystem.model.task.TaskData;
|
||||
import com.intellij.openapi.externalSystem.service.ParametersEnhancer;
|
||||
import com.intellij.openapi.util.KeyValue;
|
||||
import org.gradle.tooling.model.idea.IdeaModule;
|
||||
import org.gradle.tooling.model.idea.IdeaProject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.GradleManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -67,7 +65,7 @@ public interface GradleProjectResolverExtension extends ParametersEnhancer {
|
||||
ModuleData createModule(@NotNull IdeaModule gradleModule, @NotNull ProjectData projectData);
|
||||
|
||||
/**
|
||||
* Populates extra models of the given ide module on the basis of the information provided by {@link org.jetbrains.plugins.gradle.model.ModelBuilderService}
|
||||
* Populates extra models of the given ide module on the basis of the information provided by {@link org.jetbrains.plugins.gradle.tooling.ModelBuilderService}
|
||||
*
|
||||
* @param ideModule corresponding module from intellij gradle plugin domain
|
||||
*/
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ import org.gradle.tooling.ProjectConnection;
|
||||
import org.gradle.tooling.model.idea.IdeaModule;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectImportAction;
|
||||
import org.jetbrains.plugins.gradle.settings.GradleExecutionSettings;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
+1
-2
@@ -37,7 +37,6 @@ import com.intellij.util.containers.FactoryMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.data.BuildScriptClasspathData;
|
||||
import org.jetbrains.plugins.gradle.model.data.ClasspathEntry;
|
||||
import org.jetbrains.plugins.gradle.service.GradleBuildClasspathManager;
|
||||
import org.jetbrains.plugins.gradle.service.GradleInstallationManager;
|
||||
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings;
|
||||
@@ -121,7 +120,7 @@ public class BuildClasspathModuleGradleDataService implements ProjectDataService
|
||||
|
||||
final Set<String> buildClasspath = ContainerUtil.newHashSet();
|
||||
BuildScriptClasspathData buildScriptClasspathData = node.getData();
|
||||
for (ClasspathEntry classpathEntry : buildScriptClasspathData.getClasspathEntries()) {
|
||||
for (BuildScriptClasspathData.ClasspathEntry classpathEntry : buildScriptClasspathData.getClasspathEntries()) {
|
||||
if (classpathEntry.getSourcesFile() != null) {
|
||||
buildClasspath.add(FileUtil.toCanonicalPath(classpathEntry.getSourcesFile().getPath()));
|
||||
}
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package org.jetbrains.plugins.gradle.model;
|
||||
|
||||
import com.intellij.openapi.externalSystem.model.project.ContentRootData;
|
||||
import com.intellij.openapi.externalSystem.model.project.ModuleData;
|
||||
import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Denis Zhdanov
|
||||
* @since 8/31/11 1:33 PM
|
||||
*/
|
||||
public class GradleContentRootTest {
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void pathOutOfContentRoot() {
|
||||
throw new IllegalArgumentException();
|
||||
// TODO den implement
|
||||
// ContentRootData contentRoot = new ContentRootData(new ModuleData("module", "."), "./my-content-root");
|
||||
// contentRoot.storePath(ExternalSystemSourceType.SOURCE, "./my-dir-out-of-content-root");
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package org.jetbrains.plugins.gradle.model;
|
||||
|
||||
import com.intellij.openapi.externalSystem.model.project.ProjectData;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author Denis Zhdanov
|
||||
* @since 8/29/11 1:28 PM
|
||||
*/
|
||||
public class GradleProjectTest {
|
||||
|
||||
private ProjectData myProject;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
String path = new File(".").getPath();
|
||||
// TODO den implement
|
||||
// myProject = new ProjectData(path, path, id);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jdkVersion() {
|
||||
doTestJdkVersion("4", JavaSdkVersion.JDK_1_4);
|
||||
doTestJdkVersion(" 5", JavaSdkVersion.JDK_1_5);
|
||||
doTestJdkVersion("6 ", JavaSdkVersion.JDK_1_6);
|
||||
doTestJdkVersion(" 7 ", JavaSdkVersion.JDK_1_7);
|
||||
doTestJdkVersion(" 1.4 ", JavaSdkVersion.JDK_1_4);
|
||||
doTestJdkVersion("this is version 1.5.1_0b12 ", JavaSdkVersion.JDK_1_5);
|
||||
}
|
||||
|
||||
private void doTestJdkVersion(@NotNull String version, @NotNull JavaSdkVersion expected) {
|
||||
// TODO den implement
|
||||
// myProject.setJdkVersion(version);
|
||||
// assertEquals(expected, myProject.getJdkVersion());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testSources" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testData" type="java-test-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="annotations" />
|
||||
<orderEntry type="module" module-name="external-system-api" />
|
||||
<orderEntry type="module" module-name="gradle-tooling-extension" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="testFramework-java" scope="TEST" />
|
||||
<orderEntry type="module" module-name="gradle" scope="TEST" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Gradle">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-tooling-api-1.11-rc-1.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-core-1.11-rc-1.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-base-services-1.11-rc-1.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-ide-1.11-rc-1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/buildSrc/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/buildSrc/src/test/resources" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ui/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ui/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ui/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/cli/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/cpp/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/cpp/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ear/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ide/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ide/src/main/resources" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ivy/src/main/java/org/gradle/api/publish/ivy/tasks" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ivy/src/main/java/org/gradle/api/publish/ivy/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/ivy/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/core/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/core/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/core/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/core/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/osgi/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/osgi/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/antlr/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/jetty/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/maven/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/maven/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/scala/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/scala/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/jacoco/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/native/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/plugins/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/plugins/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/plugins/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/publish/src/main/groovy/org/gradle/api/publish/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/publish/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/wrapper/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/wrapper/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/announce/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/launcher/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/launcher/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/launcher/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/open-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/open-api/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/core-impl/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/core-impl/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/messaging/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/messaging/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/reporting/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/resources/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/javascript/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/testjar/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/testjar/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-impl/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-impl/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/singleModule/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/singleModule/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/enforcerplugin/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-impl/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-impl/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/diagnostics/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/diagnostics/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/diagnostics/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/performance/src/configPlugin" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/performance/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/tooling-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/tooling-api/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/tooling-api/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/code-quality/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/language-jvm/src/main/groovy/org/gradle/language/jvm/tasks" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/language-jvm/src/main/groovy/org/gradle/language/jvm/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/language-jvm/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/base-services/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/base-services/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/language-base/src/main/groovy/org/gradle/language/base/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/language-base/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-comparison/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-comparison/src/integTest/resources/org/gradle/api/plugins/buildcomparison/gradle/BuildComparisonIntegrationSpec/compareArchives/source/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/build-comparison/src/integTest/resources/org/gradle/api/plugins/buildcomparison/gradle/BuildComparisonIntegrationSpec/compareArchives/target/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/internal-testing/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/base-services-groovy/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-1.11-rc-1-src.zip!/gradle-1.11-rc-1/subprojects/base-services-groovy/src/test/groovy" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="GradleGuava">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/guava-jdk5-14.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Groovy" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
-5
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2000-2013 JetBrains s.r.o.
|
||||
# Copyright 2000-2014 JetBrains s.r.o.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,5 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
org.jetbrains.plugins.gradle.model.builder.WarModelBuilderImpl
|
||||
org.jetbrains.plugins.gradle.model.builder.ModelDependenciesBuilderImpl
|
||||
org.jetbrains.plugins.gradle.model.builder.ModuleExtendedModelBuilderImpl
|
||||
org.jetbrains.plugins.gradle.model.builder.ModelBuildScriptClasspathBuilderImpl
|
||||
org.jetbrains.plugins.gradle.tooling.v1_11.builder.ModelDependenciesBuilderImpl
|
||||
org.jetbrains.plugins.gradle.tooling.v1_11.builder.ModelBuildScriptClasspathBuilderImpl
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.v1_11.builder;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.plugins.ide.idea.IdeaPlugin;
|
||||
import org.gradle.plugins.ide.idea.model.IdeaModel;
|
||||
import org.gradle.plugins.ide.internal.IdeDependenciesExtractor;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeRepoFileDependency;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel;
|
||||
import org.jetbrains.plugins.gradle.model.ClasspathEntryModel;
|
||||
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.BuildScriptClasspathModelImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.ClasspathEntryModelImpl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 12/20/13
|
||||
*/
|
||||
@TargetVersions("1.11+")
|
||||
public class ModelBuildScriptClasspathBuilderImpl implements ModelBuilderService {
|
||||
|
||||
private final Map<String, BuildScriptClasspathModelImpl> cache = new ConcurrentHashMap<String, BuildScriptClasspathModelImpl>();
|
||||
|
||||
@Override
|
||||
public boolean canBuild(String modelName) {
|
||||
return BuildScriptClasspathModel.class.getName().equals(modelName);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object buildAll(final String modelName, final Project project) {
|
||||
BuildScriptClasspathModelImpl buildScriptClasspath = cache.get(project.getPath());
|
||||
if (buildScriptClasspath != null) return buildScriptClasspath;
|
||||
|
||||
boolean offline = false;
|
||||
boolean downloadJavadoc = false;
|
||||
boolean downloadSources = true;
|
||||
|
||||
final IdeaPlugin ideaPlugin = project.getPlugins().getPlugin(IdeaPlugin.class);
|
||||
|
||||
if (ideaPlugin != null) {
|
||||
IdeaModel ideaModel = ideaPlugin.getModel();
|
||||
if (ideaModel != null && ideaModel.getModule() != null) {
|
||||
offline = ideaModel.getModule().isOffline();
|
||||
downloadJavadoc = ideaModel.getModule().isDownloadJavadoc();
|
||||
downloadSources = ideaModel.getModule().isDownloadSources();
|
||||
}
|
||||
}
|
||||
|
||||
buildScriptClasspath = new BuildScriptClasspathModelImpl();
|
||||
Project parent = project.getParent();
|
||||
if (parent != null) {
|
||||
BuildScriptClasspathModelImpl parentBuildScriptClasspath = (BuildScriptClasspathModelImpl)buildAll(modelName, parent);
|
||||
if (parentBuildScriptClasspath != null) {
|
||||
for (ClasspathEntryModel classpathEntryModel : parentBuildScriptClasspath.getClasspath()) {
|
||||
buildScriptClasspath.add(classpathEntryModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final IdeDependenciesExtractor dependenciesExtractor = new IdeDependenciesExtractor();
|
||||
|
||||
final Configuration configuration = project.getBuildscript().getConfigurations().findByName("classpath");
|
||||
Collection<Configuration> plusConfigurations = Collections.singletonList(configuration);
|
||||
|
||||
if (!offline) {
|
||||
// download sources and/or javadoc
|
||||
List<IdeRepoFileDependency> repoFileDependencies = dependenciesExtractor.extractRepoFileDependencies(
|
||||
project.getConfigurations(), plusConfigurations, new ArrayList<Configuration>(), downloadSources, downloadJavadoc);
|
||||
|
||||
for (IdeRepoFileDependency dependency : repoFileDependencies) {
|
||||
if (dependency.getFile() == null) continue;
|
||||
|
||||
buildScriptClasspath.add(
|
||||
new ClasspathEntryModelImpl(dependency.getFile(), dependency.getSourceFile(), dependency.getJavadocFile()));
|
||||
}
|
||||
}
|
||||
|
||||
final Collection<IdeLocalFileDependency> localFileDependencies =
|
||||
dependenciesExtractor.extractLocalFileDependencies(plusConfigurations, new ArrayList<Configuration>());
|
||||
|
||||
for (IdeLocalFileDependency dependency : localFileDependencies) {
|
||||
if (dependency.getFile() == null) continue;
|
||||
buildScriptClasspath.add(new ClasspathEntryModelImpl(dependency.getFile(), null, null));
|
||||
}
|
||||
|
||||
cache.put(project.getPath(), buildScriptClasspath);
|
||||
return buildScriptClasspath;
|
||||
}
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.v1_11.builder;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.plugins.ide.idea.IdeaPlugin;
|
||||
import org.gradle.plugins.ide.idea.model.IdeaModel;
|
||||
import org.gradle.plugins.ide.internal.IdeDependenciesExtractor;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeProjectDependency;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeRepoFileDependency;
|
||||
import org.gradle.tooling.model.idea.IdeaDependency;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.GradleDependencyScope;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectDependenciesModel;
|
||||
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.*;
|
||||
import org.jetbrains.plugins.gradle.tooling.v1_11.internal.DependencyVersionId;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static org.jetbrains.plugins.gradle.tooling.v1_11.internal.ModelDependenciesBuilderImplHelper.*;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/5/13
|
||||
*/
|
||||
@TargetVersions("1.11+")
|
||||
public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
|
||||
@Override
|
||||
public boolean canBuild(String modelName) {
|
||||
return ProjectDependenciesModel.class.getName().equals(modelName);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object buildAll(final String modelName, final Project project) {
|
||||
final List<IdeaDependency> dependencies = new ArrayList<IdeaDependency>();
|
||||
|
||||
final Map<DependencyVersionId, Scopes> scopesMap = new LinkedHashMap<DependencyVersionId, Scopes>();
|
||||
final IdeDependenciesExtractor dependenciesExtractor = new IdeDependenciesExtractor();
|
||||
|
||||
boolean offline = false;
|
||||
boolean downloadJavadoc = false;
|
||||
boolean downloadSources = true;
|
||||
|
||||
final IdeaPlugin ideaPlugin = project.getPlugins().getPlugin(IdeaPlugin.class);
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes = Collections.emptyMap();
|
||||
if (ideaPlugin != null) {
|
||||
IdeaModel ideaModel = ideaPlugin.getModel();
|
||||
if (ideaModel != null && ideaModel.getModule() != null) {
|
||||
offline = ideaModel.getModule().isOffline();
|
||||
downloadJavadoc = ideaModel.getModule().isDownloadJavadoc();
|
||||
downloadSources = ideaModel.getModule().isDownloadSources();
|
||||
userScopes = ideaModel.getModule().getScopes();
|
||||
}
|
||||
}
|
||||
|
||||
for (final Configuration configuration : project.getConfigurations()) {
|
||||
Collection<Configuration> plusConfigurations = new ArrayList<Configuration>();
|
||||
plusConfigurations.add(configuration);
|
||||
|
||||
final Collection<IdeProjectDependency> ideProjectDependencies =
|
||||
dependenciesExtractor.extractProjectDependencies(project, plusConfigurations, new ArrayList<Configuration>());
|
||||
|
||||
for (IdeProjectDependency ideProjectDependency : ideProjectDependencies) {
|
||||
merge(scopesMap, ideProjectDependency, userScopes);
|
||||
}
|
||||
|
||||
if (!offline) {
|
||||
final Collection<IdeRepoFileDependency> ideRepoFileDependencies =
|
||||
dependenciesExtractor.extractRepoFileDependencies(
|
||||
project.getConfigurations(), plusConfigurations, new ArrayList<Configuration>(), downloadSources, downloadJavadoc);
|
||||
for (IdeRepoFileDependency repoFileDependency : ideRepoFileDependencies) {
|
||||
merge(scopesMap, repoFileDependency, userScopes);
|
||||
}
|
||||
}
|
||||
|
||||
final Collection<IdeLocalFileDependency> ideLocalFileDependencies =
|
||||
dependenciesExtractor.extractLocalFileDependencies(plusConfigurations, new ArrayList<Configuration>());
|
||||
for (IdeLocalFileDependency fileDependency : ideLocalFileDependencies) {
|
||||
merge(scopesMap, fileDependency, userScopes);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<DependencyVersionId, Scopes> entry : scopesMap.entrySet()) {
|
||||
DependencyVersionId versionId = entry.getKey();
|
||||
for (GradleDependencyScope scope : entry.getValue().getScopes()) {
|
||||
if (versionId.getIdeDependency() instanceof IdeRepoFileDependency) {
|
||||
IdeRepoFileDependency repoFileDependency =
|
||||
(IdeRepoFileDependency)versionId.getIdeDependency();
|
||||
IdeaSingleEntryLibraryDependencyImpl libraryDependency = new IdeaSingleEntryLibraryDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
versionId.getName(),
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
libraryDependency.setFile(repoFileDependency.getFile());
|
||||
libraryDependency.setSource(repoFileDependency.getSourceFile());
|
||||
libraryDependency.setJavadoc(repoFileDependency.getJavadocFile());
|
||||
dependencies.add(libraryDependency);
|
||||
}
|
||||
else if (versionId.getIdeDependency() instanceof IdeProjectDependency) {
|
||||
IdeProjectDependency projectDependency =
|
||||
(IdeProjectDependency)versionId.getIdeDependency();
|
||||
|
||||
String ideaModuleName = findDeDuplicatedModuleName(projectDependency.getProject());
|
||||
if (ideaModuleName == null) {
|
||||
ideaModuleName = versionId.getName();
|
||||
}
|
||||
|
||||
IdeaModuleDependencyImpl moduleDependency = new IdeaModuleDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
ideaModuleName,
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
moduleDependency.setIdeaModule(new StubIdeaModule(ideaModuleName));
|
||||
dependencies.add(moduleDependency);
|
||||
}
|
||||
else if (versionId.getIdeDependency() instanceof IdeLocalFileDependency) {
|
||||
IdeLocalFileDependency fileDependency =
|
||||
(IdeLocalFileDependency)versionId.getIdeDependency();
|
||||
IdeaSingleEntryLibraryDependencyImpl libraryDependency = new IdeaSingleEntryLibraryDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
versionId.getName(),
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
libraryDependency.setFile(fileDependency.getFile());
|
||||
attachGradleSdkSources(libraryDependency, fileDependency);
|
||||
dependencies.add(libraryDependency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ProjectDependenciesModelImpl(project.getPath(), dependencies);
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.v1_11.internal;
|
||||
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeDependency;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/25/13
|
||||
*/
|
||||
public class DependencyVersionId {
|
||||
private final IdeDependency myIdeDependency;
|
||||
private final String myName;
|
||||
private final String myGroup;
|
||||
private final String myVersion;
|
||||
private final String myClassifier;
|
||||
|
||||
public DependencyVersionId(IdeDependency dependency,
|
||||
String name,
|
||||
String group,
|
||||
String version,
|
||||
String classifier) {
|
||||
myIdeDependency = dependency;
|
||||
myName = name;
|
||||
myGroup = group;
|
||||
myVersion = version;
|
||||
myClassifier = classifier;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return myName;
|
||||
}
|
||||
|
||||
public String getGroup() {
|
||||
return myGroup;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return myVersion;
|
||||
}
|
||||
|
||||
public String getClassifier() {
|
||||
return myClassifier;
|
||||
}
|
||||
|
||||
public IdeDependency getIdeDependency() {
|
||||
return myIdeDependency;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof DependencyVersionId)) return false;
|
||||
|
||||
DependencyVersionId id = (DependencyVersionId)o;
|
||||
|
||||
if (myGroup != null ? !myGroup.equals(id.myGroup) : id.myGroup != null) return false;
|
||||
if (myName != null ? !myName.equals(id.myName) : id.myName != null) return false;
|
||||
if (myVersion != null ? !myVersion.equals(id.myVersion) : id.myVersion != null) return false;
|
||||
if (myClassifier != null ? !myClassifier.equals(id.myClassifier) : id.myClassifier != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = myName != null ? myName.hashCode() : 0;
|
||||
result = 31 * result + (myGroup != null ? myGroup.hashCode() : 0);
|
||||
result = 31 * result + (myVersion != null ? myVersion.hashCode() : 0);
|
||||
result = 31 * result + (myClassifier != null ? myClassifier.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DependencyVersionId{" +
|
||||
"name='" + myName + '\'' +
|
||||
", group='" + myGroup + '\'' +
|
||||
", version='" + myVersion + '\'' +
|
||||
", classifier='" + myClassifier + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.v1_11.internal;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.artifacts.ModuleIdentifier;
|
||||
import org.gradle.api.artifacts.ModuleVersionIdentifier;
|
||||
import org.gradle.plugins.ide.idea.GenerateIdeaModule;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeProjectDependency;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.IdeRepoFileDependency;
|
||||
import org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency;
|
||||
import org.gradle.util.GradleVersion;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.GradleDependencyScope;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.IdeaSingleEntryLibraryDependencyImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.Scopes;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 2/3/14
|
||||
*/
|
||||
public class ModelDependenciesBuilderImplHelper {
|
||||
|
||||
private static final String MODULE_PROPERTY = "ideaModule";
|
||||
private static final String VERSION_PROPERTY = "version";
|
||||
private static final String GROUP_PROPERTY = "group";
|
||||
|
||||
|
||||
public static void attachGradleSdkSources(IdeaSingleEntryLibraryDependencyImpl libraryDependency,
|
||||
IdeLocalFileDependency localFileDependency) {
|
||||
final String libName = localFileDependency.getFile().getName();
|
||||
if (localFileDependency.getFile() == null || !libName.startsWith("gradle-")) return;
|
||||
|
||||
File libOrPluginsFile = localFileDependency.getFile().getParentFile();
|
||||
if (libOrPluginsFile != null && ("plugins".equals(libOrPluginsFile.getName()))) {
|
||||
libOrPluginsFile = libOrPluginsFile.getParentFile();
|
||||
}
|
||||
|
||||
if (libOrPluginsFile != null && "lib".equals(libOrPluginsFile.getName()) && libOrPluginsFile.getParentFile() != null) {
|
||||
File srcDir = new File(libOrPluginsFile.getParentFile(), "src");
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("1.9")) >= 0) {
|
||||
int endIndex = libName.indexOf(GradleVersion.current().getVersion() + ".jar");
|
||||
if (endIndex != -1) {
|
||||
String srcDirChild = libName.substring("gradle-".length(), endIndex - 1);
|
||||
srcDir = new File(srcDir, srcDirChild);
|
||||
}
|
||||
}
|
||||
|
||||
if (srcDir.isDirectory()) {
|
||||
libraryDependency.setSource(srcDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String findDeDuplicatedModuleName(Project project) {
|
||||
if (project.hasProperty(MODULE_PROPERTY)) {
|
||||
Object ideaModule = project.property(MODULE_PROPERTY);
|
||||
if (ideaModule instanceof GenerateIdeaModule) {
|
||||
GenerateIdeaModule generateIdeaModule = (GenerateIdeaModule)ideaModule;
|
||||
return generateIdeaModule.getModule().getName();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
IdeProjectDependency dependency,
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes) {
|
||||
final String configurationName = dependency.getDeclaredConfiguration().getName();
|
||||
final GradleDependencyScope scope = deduceScope(configurationName, userScopes);
|
||||
if (scope == null) return;
|
||||
|
||||
final Project project = dependency.getProject();
|
||||
final String version = project.hasProperty(VERSION_PROPERTY) ? str(project.property(VERSION_PROPERTY)) : "";
|
||||
final String group = project.hasProperty(GROUP_PROPERTY) ? str(project.property(GROUP_PROPERTY)) : "";
|
||||
|
||||
DependencyVersionId versionId =
|
||||
new DependencyVersionId(dependency, project.getName(), group, version, null);
|
||||
Scopes scopes = map.get(versionId);
|
||||
if (scopes == null) {
|
||||
map.put(versionId, new Scopes(scope));
|
||||
}
|
||||
else {
|
||||
scopes.add(scope);
|
||||
}
|
||||
}
|
||||
|
||||
public static String str(Object o) {
|
||||
return String.valueOf(o == null ? "" : o);
|
||||
}
|
||||
|
||||
public static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
IdeRepoFileDependency dependency,
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes) {
|
||||
final String configurationName = dependency.getDeclaredConfiguration().getName();
|
||||
final GradleDependencyScope scope = deduceScope(configurationName, userScopes);
|
||||
if (scope == null) return;
|
||||
|
||||
final ModuleVersionIdentifier dependencyId;
|
||||
if (dependency instanceof UnresolvedIdeRepoFileDependency) {
|
||||
UnresolvedIdeRepoFileDependency unresolvedDependency =
|
||||
(UnresolvedIdeRepoFileDependency)dependency;
|
||||
dependencyId = new MyModuleVersionIdentifier(unresolvedDependency.getFile().getName());
|
||||
}
|
||||
else {
|
||||
dependencyId = dependency.getId();
|
||||
}
|
||||
|
||||
String classifier = parseClassifier(dependencyId, dependency.getFile());
|
||||
DependencyVersionId versionId =
|
||||
new DependencyVersionId(dependency, dependencyId.getName(), dependencyId.getGroup(), dependencyId.getVersion(), classifier);
|
||||
Scopes scopes = map.get(versionId);
|
||||
if (scopes == null) {
|
||||
map.put(versionId, new Scopes(scope));
|
||||
}
|
||||
else {
|
||||
scopes.add(scope);
|
||||
}
|
||||
}
|
||||
|
||||
public static String parseClassifier(ModuleVersionIdentifier dependencyId, File dependencyFile) {
|
||||
if (dependencyFile == null) return null;
|
||||
String dependencyFileName = dependencyFile.getName();
|
||||
int i = dependencyFileName.indexOf(dependencyId.getName() + '-' + dependencyId.getVersion() + '-');
|
||||
return i != -1 ? dependencyFileName.substring(i, dependencyFileName.length()) : null;
|
||||
}
|
||||
|
||||
public static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
IdeLocalFileDependency dependency,
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes) {
|
||||
|
||||
final String configurationName = dependency.getDeclaredConfiguration().getName();
|
||||
final GradleDependencyScope scope = deduceScope(configurationName, userScopes);
|
||||
if (scope == null) return;
|
||||
|
||||
String path = dependency.getFile().getPath();
|
||||
DependencyVersionId versionId = new DependencyVersionId(dependency, path, "", "", null);
|
||||
Scopes scopes = map.get(versionId);
|
||||
if (scopes == null) {
|
||||
map.put(versionId, new Scopes(scope));
|
||||
}
|
||||
else {
|
||||
scopes.add(scope);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deduce configuration scope based on configuration name using gradle conventions.
|
||||
* IDEA gradle plugin only 'plus' configuration used to support configuration based on a custom configuration (not conventional)
|
||||
*
|
||||
* @param configurationName gradle configuration name
|
||||
* @param userScopes gradle IDEA plugin scopes map
|
||||
* @return deduced scope
|
||||
*/
|
||||
public static GradleDependencyScope deduceScope(String configurationName,
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes) {
|
||||
GradleDependencyScope scope = GradleDependencyScope.fromName(configurationName);
|
||||
for (Map.Entry<String, Map<String, Collection<Configuration>>> entry : userScopes.entrySet()) {
|
||||
Collection<Configuration> plusConfigurations = entry.getValue().get("plus");
|
||||
if (plusConfigurations == null) continue;
|
||||
|
||||
for (Configuration plus : plusConfigurations) {
|
||||
if (plus.getName().equals(configurationName)) {
|
||||
return GradleDependencyScope.fromIdeaMappingName(entry.getKey().toLowerCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return scope;
|
||||
}
|
||||
|
||||
public static class MyModuleVersionIdentifier implements ModuleVersionIdentifier, Serializable {
|
||||
private final String myName;
|
||||
|
||||
public MyModuleVersionIdentifier(String name) {
|
||||
|
||||
myName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroup() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleIdentifier getModule() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testSources" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testData" type="java-test-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="annotations" />
|
||||
<orderEntry type="module" module-name="external-system-api" />
|
||||
<orderEntry type="module" module-name="gradle" />
|
||||
<orderEntry type="module" module-name="gradle-tooling-extension" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="testFramework-java" scope="TEST" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Gradle">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-tooling-api-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-core-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-messaging-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-wrapper-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-base-services-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-native-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-build-init-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-plugins-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-ide-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/gradle-scala-1.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/buildSrc/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/buildSrc/src/test/resources" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cli/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cpp/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cpp/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ear/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ide/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ide/src/main/resources" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java/org/gradle/api/publish/ivy/tasks" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java/org/gradle/api/publish/ivy/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/osgi/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/osgi/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/antlr/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/jetty/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/maven/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/maven/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/scala/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/scala/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/jacoco/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/native/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/publish/src/main/groovy/org/gradle/api/publish/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/publish/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/wrapper/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/wrapper/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/announce/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/open-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/open-api/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core-impl/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core-impl/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/messaging/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/messaging/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/reporting/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/resources/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/javascript/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/testjar/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/testjar/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-impl/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-impl/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/singleModule/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/singleModule/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/enforcerplugin/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-impl/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-impl/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/performance/src/configPlugin" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/performance/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/code-quality/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy/org/gradle/language/jvm/tasks" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy/org/gradle/language/jvm/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-base/src/main/groovy/org/gradle/language/base/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-base/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/integTest/resources/org/gradle/api/plugins/buildcomparison/gradle/BuildComparisonIntegrationSpec/compareArchives/source/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/integTest/resources/org/gradle/api/plugins/buildcomparison/gradle/BuildComparisonIntegrationSpec/compareArchives/target/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/internal-testing/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services-groovy/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services-groovy/src/test/groovy" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="GradleGuava">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/guava-jdk5-14.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Groovy" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
Binary file not shown.
+20
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Copyright 2000-2014 JetBrains s.r.o.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
org.jetbrains.plugins.gradle.tooling.v1_9.builder.WarModelBuilderImpl
|
||||
org.jetbrains.plugins.gradle.tooling.v1_9.builder.ModelDependenciesBuilderImpl
|
||||
org.jetbrains.plugins.gradle.tooling.v1_9.builder.ModuleExtendedModelBuilderImpl
|
||||
org.jetbrains.plugins.gradle.tooling.v1_9.builder.ModelBuildScriptClasspathBuilderImpl
|
||||
org.jetbrains.plugins.gradle.tooling.v1_9.builder.ScalaModelBuilderImpl
|
||||
+6
-4
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.builder;
|
||||
package org.jetbrains.plugins.gradle.tooling.v1_9.builder;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
@@ -23,9 +23,10 @@ import org.gradle.plugins.ide.internal.IdeDependenciesExtractor;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel;
|
||||
import org.jetbrains.plugins.gradle.model.ClasspathEntryModel;
|
||||
import org.jetbrains.plugins.gradle.model.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.model.internal.BuildScriptClasspathModelImpl;
|
||||
import org.jetbrains.plugins.gradle.model.internal.ClasspathEntryModelImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.BuildScriptClasspathModelImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.ClasspathEntryModelImpl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -34,6 +35,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* @author Vladislav.Soroka
|
||||
* @since 12/20/13
|
||||
*/
|
||||
@TargetVersions("1.8 <=> 1.10")
|
||||
public class ModelBuildScriptClasspathBuilderImpl implements ModelBuilderService {
|
||||
|
||||
private final Map<String, BuildScriptClasspathModelImpl> cache = new ConcurrentHashMap<String, BuildScriptClasspathModelImpl>();
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.v1_9.builder;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.plugins.ide.idea.IdeaPlugin;
|
||||
import org.gradle.plugins.ide.idea.model.IdeaModel;
|
||||
import org.gradle.plugins.ide.internal.IdeDependenciesExtractor;
|
||||
import org.gradle.tooling.model.idea.IdeaDependency;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.GradleDependencyScope;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectDependenciesModel;
|
||||
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.*;
|
||||
import org.jetbrains.plugins.gradle.tooling.v1_9.internal.DependencyVersionId;
|
||||
import org.jetbrains.plugins.gradle.tooling.v1_9.internal.ModelDependenciesBuilderImplHelper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/5/13
|
||||
*/
|
||||
@TargetVersions("1.8 <=> 1.10")
|
||||
public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
@Override
|
||||
public boolean canBuild(String modelName) {
|
||||
return ProjectDependenciesModel.class.getName().equals(modelName);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object buildAll(final String modelName, final Project project) {
|
||||
|
||||
final List<IdeaDependency> dependencies = new ArrayList<IdeaDependency>();
|
||||
|
||||
final Map<DependencyVersionId, Scopes> scopesMap = new LinkedHashMap<DependencyVersionId, Scopes>();
|
||||
final IdeDependenciesExtractor dependenciesExtractor = new IdeDependenciesExtractor();
|
||||
|
||||
boolean offline = false;
|
||||
boolean downloadJavadoc = false;
|
||||
boolean downloadSources = true;
|
||||
|
||||
final IdeaPlugin ideaPlugin = project.getPlugins().getPlugin(IdeaPlugin.class);
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes = Collections.emptyMap();
|
||||
if (ideaPlugin != null) {
|
||||
IdeaModel ideaModel = ideaPlugin.getModel();
|
||||
if (ideaModel != null && ideaModel.getModule() != null) {
|
||||
offline = ideaModel.getModule().isOffline();
|
||||
downloadJavadoc = ideaModel.getModule().isDownloadJavadoc();
|
||||
downloadSources = ideaModel.getModule().isDownloadSources();
|
||||
userScopes = ideaModel.getModule().getScopes();
|
||||
}
|
||||
}
|
||||
|
||||
for (final Configuration configuration : project.getConfigurations()) {
|
||||
Collection<Configuration> plusConfigurations = new ArrayList<Configuration>();
|
||||
plusConfigurations.add(configuration);
|
||||
|
||||
final List<IdeDependenciesExtractor.IdeProjectDependency> ideProjectDependencies =
|
||||
dependenciesExtractor.extractProjectDependencies(plusConfigurations, new ArrayList<Configuration>());
|
||||
|
||||
for (IdeDependenciesExtractor.IdeProjectDependency ideProjectDependency : ideProjectDependencies) {
|
||||
ModelDependenciesBuilderImplHelper.merge(scopesMap, ideProjectDependency, userScopes);
|
||||
}
|
||||
|
||||
if (!offline) {
|
||||
final Collection<IdeDependenciesExtractor.IdeRepoFileDependency> ideRepoFileDependencies =
|
||||
dependenciesExtractor.extractRepoFileDependencies(
|
||||
project.getConfigurations(), plusConfigurations, new ArrayList<Configuration>(), downloadSources, downloadJavadoc);
|
||||
for (IdeDependenciesExtractor.IdeRepoFileDependency repoFileDependency : ideRepoFileDependencies) {
|
||||
ModelDependenciesBuilderImplHelper.merge(scopesMap, repoFileDependency, userScopes);
|
||||
}
|
||||
}
|
||||
|
||||
final List<IdeDependenciesExtractor.IdeLocalFileDependency> ideLocalFileDependencies =
|
||||
dependenciesExtractor.extractLocalFileDependencies(plusConfigurations, new ArrayList<Configuration>());
|
||||
for (IdeDependenciesExtractor.IdeLocalFileDependency fileDependency : ideLocalFileDependencies) {
|
||||
ModelDependenciesBuilderImplHelper.merge(scopesMap, fileDependency, userScopes);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<DependencyVersionId, Scopes> entry : scopesMap.entrySet()) {
|
||||
DependencyVersionId versionId = entry.getKey();
|
||||
for (GradleDependencyScope scope : entry.getValue().getScopes()) {
|
||||
if (versionId.getIdeDependency() instanceof IdeDependenciesExtractor.IdeRepoFileDependency) {
|
||||
IdeDependenciesExtractor.IdeRepoFileDependency repoFileDependency =
|
||||
(IdeDependenciesExtractor.IdeRepoFileDependency)versionId.getIdeDependency();
|
||||
IdeaSingleEntryLibraryDependencyImpl libraryDependency = new IdeaSingleEntryLibraryDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
versionId.getName(),
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
libraryDependency.setFile(repoFileDependency.getFile());
|
||||
libraryDependency.setSource(repoFileDependency.getSourceFile());
|
||||
libraryDependency.setJavadoc(repoFileDependency.getJavadocFile());
|
||||
dependencies.add(libraryDependency);
|
||||
}
|
||||
else if (versionId.getIdeDependency() instanceof IdeDependenciesExtractor.IdeProjectDependency) {
|
||||
IdeDependenciesExtractor.IdeProjectDependency projectDependency =
|
||||
(IdeDependenciesExtractor.IdeProjectDependency)versionId.getIdeDependency();
|
||||
|
||||
String ideaModuleName = ModelDependenciesBuilderImplHelper.findDeDuplicatedModuleName(projectDependency.getProject());
|
||||
if (ideaModuleName == null) {
|
||||
ideaModuleName = versionId.getName();
|
||||
}
|
||||
|
||||
IdeaModuleDependencyImpl moduleDependency = new IdeaModuleDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
ideaModuleName,
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
moduleDependency.setIdeaModule(new StubIdeaModule(ideaModuleName));
|
||||
dependencies.add(moduleDependency);
|
||||
}
|
||||
else if (versionId.getIdeDependency() instanceof IdeDependenciesExtractor.IdeLocalFileDependency) {
|
||||
IdeDependenciesExtractor.IdeLocalFileDependency fileDependency =
|
||||
(IdeDependenciesExtractor.IdeLocalFileDependency)versionId.getIdeDependency();
|
||||
IdeaSingleEntryLibraryDependencyImpl libraryDependency = new IdeaSingleEntryLibraryDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
versionId.getName(),
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
libraryDependency.setFile(fileDependency.getFile());
|
||||
ModelDependenciesBuilderImplHelper.attachGradleSdkSources(libraryDependency, fileDependency);
|
||||
dependencies.add(libraryDependency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ProjectDependenciesModelImpl(project.getPath(), dependencies);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.builder;
|
||||
package org.jetbrains.plugins.gradle.tooling.v1_9.builder;
|
||||
|
||||
import groovy.lang.GroovyObject;
|
||||
import org.gradle.api.Project;
|
||||
@@ -26,11 +26,11 @@ import org.gradle.plugins.ide.idea.IdeaPlugin;
|
||||
import org.gradle.plugins.ide.idea.model.IdeaModel;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.ExtIdeaContentRoot;
|
||||
import org.jetbrains.plugins.gradle.model.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.model.ModuleExtendedModel;
|
||||
import org.jetbrains.plugins.gradle.model.internal.IdeaContentRootImpl;
|
||||
import org.jetbrains.plugins.gradle.model.internal.IdeaSourceDirectoryImpl;
|
||||
import org.jetbrains.plugins.gradle.model.internal.ModuleExtendedModelImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.IdeaContentRootImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.IdeaSourceDirectoryImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.ModuleExtendedModelImpl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.v1_9.builder;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.Task;
|
||||
import org.gradle.api.plugins.scala.ScalaPlugin;
|
||||
import org.gradle.api.tasks.scala.ScalaCompile;
|
||||
import org.gradle.api.tasks.scala.ScalaCompileOptions;
|
||||
import org.gradle.api.tasks.scala.ScalaForkOptions;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.ScalaModel;
|
||||
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.scala.ScalaCompileOptionsImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.scala.ScalaForkOptionsImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.scala.ScalaModelImpl;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public class ScalaModelBuilderImpl implements ModelBuilderService {
|
||||
|
||||
private static final String COMPILE_SCALA_TASK = "compileScala";
|
||||
|
||||
@Override
|
||||
public boolean canBuild(String modelName) {
|
||||
return ScalaModel.class.getName().equals(modelName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object buildAll(String modelName, Project project) {
|
||||
final ScalaPlugin scalaPlugin = project.getPlugins().findPlugin(ScalaPlugin.class);
|
||||
if (scalaPlugin == null) return null;
|
||||
|
||||
final ScalaModelImpl scalaModel = new ScalaModelImpl();
|
||||
|
||||
for (Task task : project.getTasks()) {
|
||||
if (task instanceof ScalaCompile && COMPILE_SCALA_TASK.equals(task.getName())) {
|
||||
ScalaCompile scalaCompile = (ScalaCompile)task;
|
||||
scalaModel.setScalaClasspath(scalaCompile.getScalaClasspath().getFiles());
|
||||
scalaModel.setZincClasspath(scalaCompile.getZincClasspath().getFiles());
|
||||
scalaModel.setScalaCompileOptions(create(scalaCompile.getScalaCompileOptions()));
|
||||
scalaModel.setTargetCompatibility(scalaCompile.getTargetCompatibility());
|
||||
scalaModel.setSourceCompatibility(scalaCompile.getSourceCompatibility());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return scalaModel;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Contract("null -> null")
|
||||
private static ScalaCompileOptionsImpl create(@Nullable ScalaCompileOptions options) {
|
||||
if (options == null) return null;
|
||||
|
||||
ScalaCompileOptionsImpl result = new ScalaCompileOptionsImpl();
|
||||
result.setAdditionalParameters(options.getAdditionalParameters());
|
||||
result.setDaemonServer(options.getDaemonServer());
|
||||
result.setDebugLevel(options.getDebugLevel());
|
||||
result.setDeprecation(options.isDeprecation());
|
||||
result.setEncoding(options.getEncoding());
|
||||
result.setFailOnError(options.isFailOnError());
|
||||
result.setForce(options.getForce());
|
||||
result.setFork(options.isFork());
|
||||
result.setForkOptions(create(options.getForkOptions()));
|
||||
result.setListFiles(options.isListFiles());
|
||||
result.setLoggingLevel(options.getLoggingLevel());
|
||||
result.setDebugLevel(options.getDebugLevel());
|
||||
result.setLoggingPhases(options.getLoggingPhases());
|
||||
result.setOptimize(options.isOptimize());
|
||||
result.setUnchecked(options.isUnchecked());
|
||||
result.setUseAnt(options.isUseAnt());
|
||||
result.setUseCompileDaemon(options.isUseCompileDaemon());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Contract("null -> null")
|
||||
private static ScalaForkOptionsImpl create(@Nullable ScalaForkOptions forkOptions) {
|
||||
if (forkOptions == null) return null;
|
||||
|
||||
ScalaForkOptionsImpl result = new ScalaForkOptionsImpl();
|
||||
result.setJvmArgs(forkOptions.getJvmArgs());
|
||||
result.setMemoryInitialSize(forkOptions.getMemoryInitialSize());
|
||||
result.setMemoryMaximumSize(forkOptions.getMemoryMaximumSize());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.builder;
|
||||
package org.jetbrains.plugins.gradle.tooling.v1_9.builder;
|
||||
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.Project;
|
||||
@@ -25,9 +25,9 @@ import org.gradle.api.java.archives.Manifest;
|
||||
import org.gradle.api.plugins.WarPlugin;
|
||||
import org.gradle.api.tasks.bundling.War;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.model.WarModel;
|
||||
import org.jetbrains.plugins.gradle.model.internal.WarModelImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.WarModelImpl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.StringWriter;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.v1_9.internal;
|
||||
|
||||
import org.gradle.plugins.ide.internal.IdeDependenciesExtractor;
|
||||
|
||||
+17
-132
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,152 +13,37 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.builder;
|
||||
package org.jetbrains.plugins.gradle.tooling.v1_9.internal;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.artifacts.ModuleIdentifier;
|
||||
import org.gradle.api.artifacts.ModuleVersionIdentifier;
|
||||
import org.gradle.plugins.ide.idea.GenerateIdeaModule;
|
||||
import org.gradle.plugins.ide.idea.IdeaPlugin;
|
||||
import org.gradle.plugins.ide.idea.model.IdeaModel;
|
||||
import org.gradle.plugins.ide.internal.IdeDependenciesExtractor;
|
||||
import org.gradle.tooling.model.idea.IdeaDependency;
|
||||
import org.gradle.util.GradleVersion;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.GradleDependencyScope;
|
||||
import org.jetbrains.plugins.gradle.model.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectDependenciesModel;
|
||||
import org.jetbrains.plugins.gradle.model.internal.*;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.IdeaSingleEntryLibraryDependencyImpl;
|
||||
import org.jetbrains.plugins.gradle.tooling.internal.Scopes;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/5/13
|
||||
* @since 2/3/14
|
||||
*/
|
||||
public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
public class ModelDependenciesBuilderImplHelper {
|
||||
|
||||
private static final String MODULE_PROPERTY = "ideaModule";
|
||||
private static final String VERSION_PROPERTY = "version";
|
||||
private static final String GROUP_PROPERTY = "group";
|
||||
|
||||
@Override
|
||||
public boolean canBuild(String modelName) {
|
||||
return ProjectDependenciesModel.class.getName().equals(modelName);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object buildAll(final String modelName, final Project project) {
|
||||
final List<IdeaDependency> dependencies = new ArrayList<IdeaDependency>();
|
||||
|
||||
final Map<DependencyVersionId, Scopes> scopesMap = new LinkedHashMap<DependencyVersionId, Scopes>();
|
||||
final IdeDependenciesExtractor dependenciesExtractor = new IdeDependenciesExtractor();
|
||||
|
||||
boolean offline = false;
|
||||
boolean downloadJavadoc = false;
|
||||
boolean downloadSources = true;
|
||||
|
||||
final IdeaPlugin ideaPlugin = project.getPlugins().getPlugin(IdeaPlugin.class);
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes = Collections.emptyMap();
|
||||
if (ideaPlugin != null) {
|
||||
IdeaModel ideaModel = ideaPlugin.getModel();
|
||||
if (ideaModel != null && ideaModel.getModule() != null) {
|
||||
offline = ideaModel.getModule().isOffline();
|
||||
downloadJavadoc = ideaModel.getModule().isDownloadJavadoc();
|
||||
downloadSources = ideaModel.getModule().isDownloadSources();
|
||||
userScopes = ideaModel.getModule().getScopes();
|
||||
}
|
||||
}
|
||||
|
||||
for (final Configuration configuration : project.getConfigurations()) {
|
||||
Collection<Configuration> plusConfigurations = new ArrayList<Configuration>();
|
||||
plusConfigurations.add(configuration);
|
||||
|
||||
final List<IdeDependenciesExtractor.IdeProjectDependency> ideProjectDependencies =
|
||||
dependenciesExtractor.extractProjectDependencies(plusConfigurations, new ArrayList<Configuration>());
|
||||
|
||||
for (IdeDependenciesExtractor.IdeProjectDependency ideProjectDependency : ideProjectDependencies) {
|
||||
merge(scopesMap, ideProjectDependency, userScopes);
|
||||
}
|
||||
|
||||
if (!offline) {
|
||||
final Collection<IdeDependenciesExtractor.IdeRepoFileDependency> ideRepoFileDependencies =
|
||||
dependenciesExtractor.extractRepoFileDependencies(
|
||||
project.getConfigurations(), plusConfigurations, new ArrayList<Configuration>(), downloadSources, downloadJavadoc);
|
||||
for (IdeDependenciesExtractor.IdeRepoFileDependency repoFileDependency : ideRepoFileDependencies) {
|
||||
merge(scopesMap, repoFileDependency, userScopes);
|
||||
}
|
||||
}
|
||||
|
||||
final List<IdeDependenciesExtractor.IdeLocalFileDependency> ideLocalFileDependencies =
|
||||
dependenciesExtractor.extractLocalFileDependencies(plusConfigurations, new ArrayList<Configuration>());
|
||||
for (IdeDependenciesExtractor.IdeLocalFileDependency fileDependency : ideLocalFileDependencies) {
|
||||
merge(scopesMap, fileDependency, userScopes);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<DependencyVersionId, Scopes> entry : scopesMap.entrySet()) {
|
||||
DependencyVersionId versionId = entry.getKey();
|
||||
for (GradleDependencyScope scope : entry.getValue().getScopes()) {
|
||||
if (versionId.getIdeDependency() instanceof IdeDependenciesExtractor.IdeRepoFileDependency) {
|
||||
IdeDependenciesExtractor.IdeRepoFileDependency repoFileDependency =
|
||||
(IdeDependenciesExtractor.IdeRepoFileDependency)versionId.getIdeDependency();
|
||||
IdeaSingleEntryLibraryDependencyImpl libraryDependency = new IdeaSingleEntryLibraryDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
versionId.getName(),
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
libraryDependency.setFile(repoFileDependency.getFile());
|
||||
libraryDependency.setSource(repoFileDependency.getSourceFile());
|
||||
libraryDependency.setJavadoc(repoFileDependency.getJavadocFile());
|
||||
dependencies.add(libraryDependency);
|
||||
}
|
||||
else if (versionId.getIdeDependency() instanceof IdeDependenciesExtractor.IdeProjectDependency) {
|
||||
IdeDependenciesExtractor.IdeProjectDependency projectDependency =
|
||||
(IdeDependenciesExtractor.IdeProjectDependency)versionId.getIdeDependency();
|
||||
|
||||
String ideaModuleName = findDeDuplicatedModuleName(projectDependency.getProject());
|
||||
if (ideaModuleName == null) {
|
||||
ideaModuleName = versionId.getName();
|
||||
}
|
||||
|
||||
IdeaModuleDependencyImpl moduleDependency = new IdeaModuleDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
ideaModuleName,
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
moduleDependency.setIdeaModule(new StubIdeaModule(ideaModuleName));
|
||||
dependencies.add(moduleDependency);
|
||||
}
|
||||
else if (versionId.getIdeDependency() instanceof IdeDependenciesExtractor.IdeLocalFileDependency) {
|
||||
IdeDependenciesExtractor.IdeLocalFileDependency fileDependency =
|
||||
(IdeDependenciesExtractor.IdeLocalFileDependency)versionId.getIdeDependency();
|
||||
IdeaSingleEntryLibraryDependencyImpl libraryDependency = new IdeaSingleEntryLibraryDependencyImpl(
|
||||
new IdeaDependencyScopeImpl(scope),
|
||||
versionId.getName(),
|
||||
versionId.getGroup(),
|
||||
versionId.getVersion(),
|
||||
versionId.getClassifier()
|
||||
);
|
||||
libraryDependency.setFile(fileDependency.getFile());
|
||||
attachGradleSdkSources(libraryDependency, fileDependency);
|
||||
dependencies.add(libraryDependency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ProjectDependenciesModelImpl(project.getPath(), dependencies);
|
||||
}
|
||||
|
||||
private static void attachGradleSdkSources(IdeaSingleEntryLibraryDependencyImpl libraryDependency,
|
||||
public static void attachGradleSdkSources(IdeaSingleEntryLibraryDependencyImpl libraryDependency,
|
||||
IdeDependenciesExtractor.IdeLocalFileDependency localFileDependency) {
|
||||
final String libName = localFileDependency.getFile().getName();
|
||||
if (localFileDependency.getFile() == null || !libName.startsWith("gradle-")) return;
|
||||
@@ -185,7 +70,7 @@ public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static String findDeDuplicatedModuleName(Project project) {
|
||||
public static String findDeDuplicatedModuleName(Project project) {
|
||||
if (project.hasProperty(MODULE_PROPERTY)) {
|
||||
Object ideaModule = project.property(MODULE_PROPERTY);
|
||||
if (ideaModule instanceof GenerateIdeaModule) {
|
||||
@@ -196,7 +81,7 @@ public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
public static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
IdeDependenciesExtractor.IdeProjectDependency dependency,
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes) {
|
||||
final String configurationName = dependency.getDeclaredConfiguration().getName();
|
||||
@@ -218,11 +103,11 @@ public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
}
|
||||
}
|
||||
|
||||
private static String str(Object o) {
|
||||
public static String str(Object o) {
|
||||
return String.valueOf(o == null ? "" : o);
|
||||
}
|
||||
|
||||
private static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
public static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
IdeDependenciesExtractor.IdeRepoFileDependency dependency,
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes) {
|
||||
final String configurationName = dependency.getDeclaredConfiguration().getName();
|
||||
@@ -251,14 +136,14 @@ public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
}
|
||||
}
|
||||
|
||||
private static String parseClassifier(ModuleVersionIdentifier dependencyId, File dependencyFile) {
|
||||
public static String parseClassifier(ModuleVersionIdentifier dependencyId, File dependencyFile) {
|
||||
if (dependencyFile == null) return null;
|
||||
String dependencyFileName = dependencyFile.getName();
|
||||
int i = dependencyFileName.indexOf(dependencyId.getName() + '-' + dependencyId.getVersion() + '-');
|
||||
return i != -1 ? dependencyFileName.substring(i, dependencyFileName.length()) : null;
|
||||
}
|
||||
|
||||
private static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
public static void merge(Map<DependencyVersionId, Scopes> map,
|
||||
IdeDependenciesExtractor.IdeLocalFileDependency dependency,
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes) {
|
||||
|
||||
@@ -286,7 +171,7 @@ public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
* @param userScopes gradle IDEA plugin scopes map
|
||||
* @return deduced scope
|
||||
*/
|
||||
private static GradleDependencyScope deduceScope(String configurationName,
|
||||
public static GradleDependencyScope deduceScope(String configurationName,
|
||||
Map<String, Map<String, Collection<Configuration>>> userScopes) {
|
||||
GradleDependencyScope scope = GradleDependencyScope.fromName(configurationName);
|
||||
for (Map.Entry<String, Map<String, Collection<Configuration>>> entry : userScopes.entrySet()) {
|
||||
@@ -303,7 +188,7 @@ public class ModelDependenciesBuilderImpl implements ModelBuilderService {
|
||||
return scope;
|
||||
}
|
||||
|
||||
private static class MyModuleVersionIdentifier implements ModuleVersionIdentifier, Serializable {
|
||||
public static class MyModuleVersionIdentifier implements ModuleVersionIdentifier, Serializable {
|
||||
private final String myName;
|
||||
|
||||
public MyModuleVersionIdentifier(String name) {
|
||||
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testSources" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/testData" type="java-test-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="external-system-api" />
|
||||
<orderEntry type="module" module-name="annotations" />
|
||||
<orderEntry type="module" module-name="testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="testFramework-java" scope="TEST" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Gradle">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-tooling-api-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-core-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-messaging-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-wrapper-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-base-services-1.9.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-native-1.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/buildSrc/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/buildSrc/src/test/resources" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ui/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cli/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cpp/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/cpp/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ear/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ide/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ide/src/main/resources" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java/org/gradle/api/publish/ivy/tasks" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java/org/gradle/api/publish/ivy/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/ivy/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/osgi/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/osgi/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/antlr/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/jetty/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/maven/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/maven/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/scala/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/scala/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/jacoco/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/native/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/plugins/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/publish/src/main/groovy/org/gradle/api/publish/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/publish/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/wrapper/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/wrapper/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/announce/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/launcher/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/open-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/open-api/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core-impl/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/core-impl/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/messaging/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/messaging/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/reporting/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/resources/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/javascript/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/testjar/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/testjar/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-impl/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/multiModule/webinar-impl/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/singleModule/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/singleModule/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/enforcerplugin/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-impl/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-init/src/integTest/resources/org/gradle/buildinit/plugins/MavenConversionIntegrationTest/flatmultimodule/webinar-impl/src/test/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/diagnostics/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/performance/src/configPlugin" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/performance/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/integTest/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/tooling-api/src/testFixtures/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/code-quality/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy/org/gradle/language/jvm/tasks" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy/org/gradle/language/jvm/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-jvm/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services/src/test/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-base/src/main/groovy/org/gradle/language/base/plugins" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/language-base/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/integTest/resources/org/gradle/api/plugins/buildcomparison/gradle/BuildComparisonIntegrationSpec/compareArchives/source/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/build-comparison/src/integTest/resources/org/gradle/api/plugins/buildcomparison/gradle/BuildComparisonIntegrationSpec/compareArchives/target/src/main/java" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/internal-testing/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services-groovy/src/main/groovy" />
|
||||
<root url="jar://$MODULE_DIR$/../lib/gradle-1.9-src.zip!/gradle-1.9/subprojects/base-services-groovy/src/test/groovy" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" scope="PROVIDED">
|
||||
<library name="GradleGuava">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../lib/guava-jdk5-14.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" scope="PROVIDED" name="Groovy" level="project" />
|
||||
<orderEntry type="module" module-name="gradle" scope="TEST" />
|
||||
<orderEntry type="module" module-name="gradle-tooling-extension-v1.9" scope="RUNTIME" />
|
||||
<orderEntry type="module" module-name="gradle-tooling-extension-v1.11" scope="RUNTIME" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+15
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Copyright 2000-2014 JetBrains s.r.o.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.service.project;
|
||||
package org.jetbrains.plugins.gradle.model;
|
||||
|
||||
import com.intellij.openapi.externalSystem.model.ExternalSystemException;
|
||||
import org.gradle.tooling.BuildAction;
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public interface ScalaCompileOptions extends Serializable {
|
||||
boolean isUseCompileDaemon();
|
||||
|
||||
String getDaemonServer();
|
||||
|
||||
boolean isFailOnError();
|
||||
|
||||
boolean isDeprecation();
|
||||
|
||||
boolean isUnchecked();
|
||||
|
||||
String getDebugLevel();
|
||||
|
||||
boolean isOptimize();
|
||||
|
||||
String getEncoding();
|
||||
|
||||
String getForce();
|
||||
|
||||
List<String> getAdditionalParameters();
|
||||
|
||||
boolean isListFiles();
|
||||
|
||||
String getLoggingLevel();
|
||||
|
||||
List<String> getLoggingPhases();
|
||||
|
||||
boolean isFork();
|
||||
|
||||
boolean isUseAnt();
|
||||
|
||||
ScalaForkOptions getForkOptions();
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public interface ScalaForkOptions extends Serializable {
|
||||
String getMemoryInitialSize();
|
||||
|
||||
String getMemoryMaximumSize();
|
||||
|
||||
List<String> getJvmArgs();
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public interface ScalaModel extends Serializable {
|
||||
|
||||
Set<File> getScalaClasspath();
|
||||
|
||||
Set<File> getZincClasspath();
|
||||
|
||||
ScalaCompileOptions getScalaCompileOptions();
|
||||
|
||||
String getSourceCompatibility();
|
||||
|
||||
String getTargetCompatibility();
|
||||
}
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model;
|
||||
package org.jetbrains.plugins.gradle.tooling;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2012 the original author or authors.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface TargetVersions {
|
||||
String value();
|
||||
boolean checkBaseVersions() default true;
|
||||
}
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.idea.IdeaDependencyScope;
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.DomainObjectSet;
|
||||
import org.gradle.tooling.model.internal.ImmutableDomainObjectSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel;
|
||||
import org.jetbrains.plugins.gradle.model.ClasspathEntryModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 12/20/13
|
||||
*/
|
||||
public class BuildScriptClasspathModelImpl implements BuildScriptClasspathModel {
|
||||
|
||||
private final List<ClasspathEntryModel> myClasspathEntries;
|
||||
|
||||
public BuildScriptClasspathModelImpl() {
|
||||
myClasspathEntries = new ArrayList<ClasspathEntryModel>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainObjectSet<? extends ClasspathEntryModel> getClasspath() {
|
||||
return ImmutableDomainObjectSet.of(myClasspathEntries);
|
||||
}
|
||||
|
||||
public void add(@NotNull ClasspathEntryModel classpathEntryModel) {
|
||||
myClasspathEntries.add(classpathEntryModel);
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.model.ClasspathEntryModel;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 12/20/13
|
||||
*/
|
||||
public class ClasspathEntryModelImpl implements ClasspathEntryModel, Serializable {
|
||||
@NotNull
|
||||
private final File classesFile;
|
||||
@Nullable
|
||||
private final File sourcesFile;
|
||||
@Nullable
|
||||
private final File javadocFile;
|
||||
|
||||
public ClasspathEntryModelImpl(@NotNull File classesFile, @Nullable File sourcesFile, @Nullable File javadocFile) {
|
||||
this.classesFile = classesFile;
|
||||
this.sourcesFile = sourcesFile;
|
||||
this.javadocFile = javadocFile;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public File getClassesFile() {
|
||||
return classesFile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public File getSourcesFile() {
|
||||
return sourcesFile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public File getJavadocFile() {
|
||||
return javadocFile;
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.tooling.provider.model.ToolingModelBuilder;
|
||||
import org.gradle.util.GradleVersion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService;
|
||||
import org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions;
|
||||
|
||||
import java.util.ServiceLoader;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/5/13
|
||||
*/
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public class ExtraModelBuilder implements ToolingModelBuilder {
|
||||
private static final String RANGE_TOKEN = " <=> ";
|
||||
private static ServiceLoader<ModelBuilderService> buildersLoader =
|
||||
ServiceLoader.load(ModelBuilderService.class, ExtraModelBuilder.class.getClassLoader());
|
||||
|
||||
@NotNull
|
||||
private final GradleVersion myCurrentGradleVersion;
|
||||
|
||||
public ExtraModelBuilder() {
|
||||
this.myCurrentGradleVersion = GradleVersion.current();
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public ExtraModelBuilder(@NotNull GradleVersion gradleVersion) {
|
||||
this.myCurrentGradleVersion = gradleVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBuild(String modelName) {
|
||||
for (ModelBuilderService service : buildersLoader) {
|
||||
if (service.canBuild(modelName) && isVersionMatch(service)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object buildAll(String modelName, Project project) {
|
||||
for (ModelBuilderService service : buildersLoader) {
|
||||
if (service.canBuild(modelName) && isVersionMatch(service)) {
|
||||
return service.buildAll(modelName, project);
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unsupported model: " + modelName);
|
||||
}
|
||||
|
||||
private boolean isVersionMatch(@NotNull ModelBuilderService builderService) {
|
||||
TargetVersions targetVersions = builderService.getClass().getAnnotation(TargetVersions.class);
|
||||
if (targetVersions == null || targetVersions.value() == null || targetVersions.value().isEmpty()) return true;
|
||||
|
||||
final GradleVersion current = adjust(myCurrentGradleVersion, targetVersions.checkBaseVersions());
|
||||
|
||||
if (targetVersions.value().endsWith("+")) {
|
||||
String minVersion = targetVersions.value().substring(0, targetVersions.value().length() - 1);
|
||||
return compare(current, minVersion, targetVersions.checkBaseVersions()) >= 0;
|
||||
}
|
||||
else {
|
||||
final int rangeIndex = targetVersions.value().indexOf(RANGE_TOKEN);
|
||||
if (rangeIndex != -1) {
|
||||
String minVersion = targetVersions.value().substring(0, rangeIndex);
|
||||
String maxVersion = targetVersions.value().substring(rangeIndex + RANGE_TOKEN.length());
|
||||
return compare(current, minVersion, targetVersions.checkBaseVersions()) >= 0 &&
|
||||
compare(current, maxVersion, targetVersions.checkBaseVersions()) <= 0;
|
||||
}
|
||||
else {
|
||||
return compare(current, targetVersions.value(), targetVersions.checkBaseVersions()) == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int compare(@NotNull GradleVersion gradleVersion, @NotNull String otherGradleVersion, boolean checkBaseVersions) {
|
||||
return gradleVersion.compareTo(adjust(GradleVersion.version(otherGradleVersion), checkBaseVersions));
|
||||
}
|
||||
|
||||
private static GradleVersion adjust(@NotNull GradleVersion version, boolean checkBaseVersions) {
|
||||
return checkBaseVersions ? version.getBaseVersion() : version;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.DomainObjectSet;
|
||||
import org.gradle.tooling.model.idea.IdeaSourceDirectory;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.idea.IdeaDependencyScope;
|
||||
import org.jetbrains.plugins.gradle.model.GradleDependencyScope;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.idea.IdeaDependencyScope;
|
||||
import org.gradle.tooling.model.idea.IdeaModule;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.GradleModuleVersion;
|
||||
import org.gradle.tooling.model.idea.IdeaDependencyScope;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.idea.IdeaSourceDirectory;
|
||||
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.DomainObjectSet;
|
||||
import org.gradle.tooling.model.internal.ImmutableDomainObjectSet;
|
||||
import org.jetbrains.plugins.gradle.model.ExtIdeaContentRoot;
|
||||
import org.jetbrains.plugins.gradle.model.ModuleExtendedModel;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/8/13
|
||||
*/
|
||||
public class ModuleExtendedModelImpl implements ModuleExtendedModel {
|
||||
private final String myName;
|
||||
private final String myGroup;
|
||||
private final String myVersion;
|
||||
private List<File> myArtifacts;
|
||||
private Set<ExtIdeaContentRoot> myContentRoots;
|
||||
|
||||
public ModuleExtendedModelImpl(String name, String group, String version) {
|
||||
myName = name;
|
||||
myGroup = group;
|
||||
myVersion = version;
|
||||
myArtifacts = Collections.emptyList();
|
||||
myContentRoots = Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroup() {
|
||||
return myGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return myVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<File> getArtifacts() {
|
||||
return myArtifacts;
|
||||
}
|
||||
|
||||
public void setArtifacts(List<File> artifacts) {
|
||||
this.myArtifacts = artifacts == null ? Collections.<File>emptyList() : artifacts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainObjectSet<? extends ExtIdeaContentRoot> getContentRoots() {
|
||||
return ImmutableDomainObjectSet.of(myContentRoots);
|
||||
}
|
||||
|
||||
public void setContentRoots(Set<ExtIdeaContentRoot> contentRoots) {
|
||||
myContentRoots = contentRoots == null ? Collections.<ExtIdeaContentRoot>emptySet() : contentRoots;
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.idea.IdeaDependency;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectDependenciesModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/8/13
|
||||
*/
|
||||
public class ProjectDependenciesModelImpl implements ProjectDependenciesModel {
|
||||
private final String projectName;
|
||||
private final List<IdeaDependency> myDependencies;
|
||||
|
||||
public ProjectDependenciesModelImpl(String projectName, List<IdeaDependency> dependencies) {
|
||||
this.projectName = projectName;
|
||||
myDependencies = dependencies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IdeaDependency> getDependencies() {
|
||||
return myDependencies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProjectDependenciesModelImpl{" +
|
||||
"projectName='" + projectName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.jetbrains.plugins.gradle.model.GradleDependencyScope;
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.internal;
|
||||
package org.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.gradle.tooling.model.DomainObjectSet;
|
||||
import org.gradle.tooling.model.GradleProject;
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal;
|
||||
|
||||
import org.jetbrains.plugins.gradle.model.WarModel;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/5/13
|
||||
*/
|
||||
public class WarModelImpl implements WarModel {
|
||||
private final String myWebAppDirName;
|
||||
private final File myWebAppDir;
|
||||
private File myWebXml;
|
||||
private Map<String, Set<String>> myWebRoots;
|
||||
private Set<File> myClasspath;
|
||||
private String myManifestContent;
|
||||
|
||||
public WarModelImpl(String webAppDirName, File webAppDir) {
|
||||
myWebAppDirName = webAppDirName;
|
||||
myWebAppDir = webAppDir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWebAppDirName() {
|
||||
return myWebAppDirName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getWebAppDir() {
|
||||
return myWebAppDir;
|
||||
}
|
||||
|
||||
public void setWebXml(File webXml) {
|
||||
myWebXml = webXml;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getWebXml() {
|
||||
return myWebXml;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Set<String>> getWebRoots() {
|
||||
return myWebRoots;
|
||||
}
|
||||
|
||||
public void setWebRoots(Map<String, Set<String>> webRoots) {
|
||||
myWebRoots = webRoots;
|
||||
}
|
||||
|
||||
public void setClasspath(Set<File> classpath) {
|
||||
myClasspath = classpath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<File> getClasspath() {
|
||||
return myClasspath;
|
||||
}
|
||||
|
||||
public void setManifestContent(String manifestContent) {
|
||||
myManifestContent = manifestContent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManifestContent() {
|
||||
return myManifestContent;
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,9 +30,10 @@ class JetGradlePlugin implements Plugin<Project> {
|
||||
}
|
||||
|
||||
try {
|
||||
URL[] urls = [new File("${JAR_PATH}").toURI().toURL()]
|
||||
String[] paths = ${EXTENSIONS_JARS_PATH}
|
||||
URL[] urls = paths.collect{ new File(it).toURI().toURL() }
|
||||
URLClassLoader classLoader = new URLClassLoader(urls, getClass().classLoader)
|
||||
Class modelClass = classLoader.loadClass('org.jetbrains.plugins.gradle.model.internal.ExtraModelBuilder')
|
||||
Class modelClass = classLoader.loadClass('org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder')
|
||||
allprojects {
|
||||
apply plugin: 'idea'
|
||||
idea.module.ext.set('resourceDirs', [])
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal.scala;
|
||||
|
||||
import org.jetbrains.plugins.gradle.model.ScalaCompileOptions;
|
||||
import org.jetbrains.plugins.gradle.model.ScalaForkOptions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public class ScalaCompileOptionsImpl implements ScalaCompileOptions {
|
||||
private boolean useCompileDaemon;
|
||||
private String daemonServer;
|
||||
private boolean failOnError;
|
||||
private boolean deprecation;
|
||||
private boolean unchecked;
|
||||
private String debugLevel;
|
||||
private boolean optimize;
|
||||
private String encoding;
|
||||
private String force;
|
||||
private List<String> additionalParameters;
|
||||
private boolean listFiles;
|
||||
private String loggingLevel;
|
||||
private List<String> loggingPhases;
|
||||
private boolean fork;
|
||||
private ScalaForkOptionsImpl forkOptions;
|
||||
private boolean useAnt;
|
||||
|
||||
@Override
|
||||
public boolean isUseCompileDaemon() {
|
||||
return useCompileDaemon;
|
||||
}
|
||||
|
||||
public void setUseCompileDaemon(boolean useCompileDaemon) {
|
||||
this.useCompileDaemon = useCompileDaemon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDaemonServer() {
|
||||
return daemonServer;
|
||||
}
|
||||
|
||||
public void setDaemonServer(String daemonServer) {
|
||||
this.daemonServer = daemonServer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFailOnError() {
|
||||
return failOnError;
|
||||
}
|
||||
|
||||
public void setFailOnError(boolean failOnError) {
|
||||
this.failOnError = failOnError;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeprecation() {
|
||||
return deprecation;
|
||||
}
|
||||
|
||||
public void setDeprecation(boolean deprecation) {
|
||||
this.deprecation = deprecation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUnchecked() {
|
||||
return unchecked;
|
||||
}
|
||||
|
||||
public void setUnchecked(boolean unchecked) {
|
||||
this.unchecked = unchecked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDebugLevel() {
|
||||
return debugLevel;
|
||||
}
|
||||
|
||||
public void setDebugLevel(String debugLevel) {
|
||||
this.debugLevel = debugLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOptimize() {
|
||||
return optimize;
|
||||
}
|
||||
|
||||
public void setOptimize(boolean optimize) {
|
||||
this.optimize = optimize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncoding() {
|
||||
return encoding;
|
||||
}
|
||||
|
||||
public void setEncoding(String encoding) {
|
||||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getForce() {
|
||||
return force;
|
||||
}
|
||||
|
||||
public void setForce(String force) {
|
||||
this.force = force;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAdditionalParameters() {
|
||||
return additionalParameters;
|
||||
}
|
||||
|
||||
public void setAdditionalParameters(List<String> additionalParameters) {
|
||||
this.additionalParameters = additionalParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListFiles() {
|
||||
return listFiles;
|
||||
}
|
||||
|
||||
public void setListFiles(boolean listFiles) {
|
||||
this.listFiles = listFiles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLoggingLevel() {
|
||||
return loggingLevel;
|
||||
}
|
||||
|
||||
public void setLoggingLevel(String loggingLevel) {
|
||||
this.loggingLevel = loggingLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLoggingPhases() {
|
||||
return loggingPhases;
|
||||
}
|
||||
|
||||
public void setLoggingPhases(List<String> loggingPhases) {
|
||||
this.loggingPhases = loggingPhases;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFork() {
|
||||
return fork;
|
||||
}
|
||||
|
||||
public void setFork(boolean fork) {
|
||||
this.fork = fork;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseAnt() {
|
||||
return useAnt;
|
||||
}
|
||||
|
||||
public void setUseAnt(boolean useAnt) {
|
||||
this.useAnt = useAnt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScalaForkOptions getForkOptions() {
|
||||
return forkOptions;
|
||||
}
|
||||
|
||||
public void setForkOptions(ScalaForkOptionsImpl forkOptions) {
|
||||
this.forkOptions = forkOptions;
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal.scala;
|
||||
|
||||
import org.jetbrains.plugins.gradle.model.ScalaForkOptions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public class ScalaForkOptionsImpl implements ScalaForkOptions {
|
||||
private String memoryInitialSize;
|
||||
private String memoryMaximumSize;
|
||||
private List<String> jvmArgs;
|
||||
|
||||
@Override
|
||||
public String getMemoryInitialSize() {
|
||||
return memoryInitialSize;
|
||||
}
|
||||
|
||||
public void setMemoryInitialSize(String memoryInitialSize) {
|
||||
this.memoryInitialSize = memoryInitialSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMemoryMaximumSize() {
|
||||
return memoryMaximumSize;
|
||||
}
|
||||
|
||||
public void setMemoryMaximumSize(String memoryMaximumSize) {
|
||||
this.memoryMaximumSize = memoryMaximumSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getJvmArgs() {
|
||||
return jvmArgs;
|
||||
}
|
||||
|
||||
public void setJvmArgs(List<String> jvmArgs) {
|
||||
this.jvmArgs = jvmArgs;
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jetbrains.plugins.gradle.tooling.internal.scala;
|
||||
|
||||
import org.jetbrains.plugins.gradle.model.ScalaCompileOptions;
|
||||
import org.jetbrains.plugins.gradle.model.ScalaModel;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 1/31/14
|
||||
*/
|
||||
public class ScalaModelImpl implements ScalaModel {
|
||||
private Set<File> scalaClasspath;
|
||||
private Set<File> zincClasspath;
|
||||
private String sourceCompatibility;
|
||||
private String targetCompatibility;
|
||||
private ScalaCompileOptionsImpl scalaCompileOptions;
|
||||
|
||||
@Override
|
||||
public Set<File> getScalaClasspath() {
|
||||
return scalaClasspath;
|
||||
}
|
||||
|
||||
public void setScalaClasspath(Set<File> scalaClasspath) {
|
||||
this.scalaClasspath = scalaClasspath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<File> getZincClasspath() {
|
||||
return zincClasspath;
|
||||
}
|
||||
|
||||
public void setZincClasspath(Set<File> zincClasspath) {
|
||||
this.zincClasspath = zincClasspath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScalaCompileOptions getScalaCompileOptions() {
|
||||
return scalaCompileOptions;
|
||||
}
|
||||
|
||||
public void setScalaCompileOptions(ScalaCompileOptionsImpl scalaCompileOptions) {
|
||||
this.scalaCompileOptions = scalaCompileOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSourceCompatibility() {
|
||||
return sourceCompatibility;
|
||||
}
|
||||
|
||||
public void setSourceCompatibility(String sourceCompatibility) {
|
||||
this.sourceCompatibility = sourceCompatibility;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTargetCompatibility() {
|
||||
return targetCompatibility;
|
||||
}
|
||||
|
||||
public void setTargetCompatibility(String targetCompatibility) {
|
||||
this.targetCompatibility = targetCompatibility;
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# Copyright 2000-2014 JetBrains s.r.o.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilderTest$TestModelBuilderService_v_1_8
|
||||
org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilderTest$TestModelBuilderService_v_1_8_or_Above
|
||||
org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilderTest$TestModelBuilderService_between_v_1_8_and_1_9
|
||||
org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilderTest$TestModelBuilderService_between_v_1_8_and_1_9_NotBase
|
||||
+49
-6
@@ -13,24 +13,30 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.builder;
|
||||
package org.jetbrains.plugins.gradle.tooling.builder;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.gradle.tooling.BuildActionExecuter;
|
||||
import org.gradle.tooling.GradleConnector;
|
||||
import org.gradle.tooling.ProjectConnection;
|
||||
import org.gradle.tooling.internal.consumer.DefaultGradleConnector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectImportAction;
|
||||
import org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper;
|
||||
import org.jetbrains.plugins.gradle.service.project.ProjectImportAction;
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
@@ -38,36 +44,73 @@ import static org.junit.Assert.assertNotNull;
|
||||
* @author Vladislav.Soroka
|
||||
* @since 11/29/13
|
||||
*/
|
||||
@RunWith(value = Parameterized.class)
|
||||
public abstract class AbstractModelBuilderTest {
|
||||
|
||||
public static final String GRADLE_v1_9 = "1.9";
|
||||
public static final String GRADLE_v1_10 = "1.10";
|
||||
public static final String GRADLE_v1_11 = "1.11-rc-1";
|
||||
|
||||
public static final Pattern TEST_METHOD_NAME_PATTERN;
|
||||
|
||||
static {
|
||||
TEST_METHOD_NAME_PATTERN = Pattern.compile("(.*)\\[(\\d*)\\]");
|
||||
}
|
||||
|
||||
private static File ourTempDir;
|
||||
|
||||
@NotNull
|
||||
private final String gradleVersion;
|
||||
protected File testDir;
|
||||
protected ProjectImportAction.AllModels allModels;
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
|
||||
public AbstractModelBuilderTest(@NotNull String gradleVersion) {
|
||||
this.gradleVersion = gradleVersion;
|
||||
}
|
||||
|
||||
@Parameterized.Parameters
|
||||
public static Collection<Object[]> data() {
|
||||
Object[][] data = new Object[][]{
|
||||
{AbstractModelBuilderTest.GRADLE_v1_9},
|
||||
{AbstractModelBuilderTest.GRADLE_v1_10},
|
||||
{AbstractModelBuilderTest.GRADLE_v1_11}};
|
||||
return Arrays.asList(data);
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
ensureTempDirCreated();
|
||||
testDir = new File(ourTempDir, name.getMethodName());
|
||||
|
||||
String methodName = name.getMethodName();
|
||||
Matcher m = TEST_METHOD_NAME_PATTERN.matcher(methodName);
|
||||
if (m.matches()) {
|
||||
methodName = m.group(1);
|
||||
}
|
||||
|
||||
testDir = new File(ourTempDir, methodName);
|
||||
testDir.mkdirs();
|
||||
|
||||
FileUtil.writeToFile(
|
||||
new File(testDir, GradleConstants.DEFAULT_SCRIPT_NAME),
|
||||
FileUtil.loadTextAndClose(getClass().getResourceAsStream(
|
||||
String.format("/%s/%s", name.getMethodName(), GradleConstants.DEFAULT_SCRIPT_NAME))
|
||||
String.format("/%s/%s", methodName, GradleConstants.DEFAULT_SCRIPT_NAME))
|
||||
)
|
||||
);
|
||||
|
||||
FileUtil.writeToFile(
|
||||
new File(testDir, GradleConstants.SETTINGS_FILE_NAME),
|
||||
FileUtil.loadTextAndClose(getClass().getResourceAsStream(
|
||||
String.format("/%s/%s", name.getMethodName(), GradleConstants.SETTINGS_FILE_NAME))
|
||||
String.format("/%s/%s", methodName, GradleConstants.SETTINGS_FILE_NAME))
|
||||
)
|
||||
);
|
||||
|
||||
GradleConnector connector = GradleConnector.newConnector();
|
||||
|
||||
DefaultGradleConnector gradleConnector = (DefaultGradleConnector)connector;
|
||||
gradleConnector.useGradleVersion(gradleVersion);
|
||||
gradleConnector.forProjectDirectory(testDir);
|
||||
ProjectConnection connection = gradleConnector.connect();
|
||||
|
||||
+8
-4
@@ -13,12 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.builder;
|
||||
package org.jetbrains.plugins.gradle.tooling.builder;
|
||||
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.gradle.tooling.model.DomainObjectSet;
|
||||
import org.gradle.tooling.model.idea.IdeaModule;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel;
|
||||
import org.jetbrains.plugins.gradle.model.ClasspathEntryModel;
|
||||
import org.junit.Test;
|
||||
@@ -35,10 +36,12 @@ import static org.junit.Assert.assertTrue;
|
||||
*/
|
||||
public class ModelBuildScriptClasspathBuilderImplTest extends AbstractModelBuilderTest {
|
||||
|
||||
public ModelBuildScriptClasspathBuilderImplTest(@NotNull String gradleVersion) {
|
||||
super(gradleVersion);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testModelBuildScriptClasspathBuilder() throws Exception {
|
||||
ModelBuildScriptClasspathBuilderImpl buildScriptClasspathBuilder = new ModelBuildScriptClasspathBuilderImpl();
|
||||
assertTrue(buildScriptClasspathBuilder.canBuild("org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel"));
|
||||
|
||||
DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getIdeaProject().getModules();
|
||||
|
||||
@@ -61,7 +64,8 @@ public class ModelBuildScriptClasspathBuilderImplTest extends AbstractModelBuild
|
||||
assertEquals("Wrong build classpath for module: " + module.getName(), 1, classpathModel.getClasspath().size());
|
||||
|
||||
ClasspathEntryModel classpathEntry = classpathModel.getClasspath().getAt(0);
|
||||
assertEquals("Wrong build classpath for module: " + module.getName(), "inheritedDep.jar", classpathEntry.getClassesFile().getName());
|
||||
assertEquals("Wrong build classpath for module: " + module.getName(), "inheritedDep.jar",
|
||||
classpathEntry.getClassesFile().getName());
|
||||
}
|
||||
else if (module.getName().equals("moduleWithoutAdditionalClasspath") ||
|
||||
module.getName().equals("testModelBuildScriptClasspathBuilder")) {
|
||||
+6
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.builder;
|
||||
package org.jetbrains.plugins.gradle.tooling.builder;
|
||||
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -25,7 +25,6 @@ import org.gradle.tooling.model.idea.IdeaSingleEntryLibraryDependency;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.gradle.model.GradleDependencyScope;
|
||||
import org.jetbrains.plugins.gradle.model.ProjectDependenciesModel;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
@@ -42,11 +41,12 @@ import static org.junit.Assert.assertNotNull;
|
||||
*/
|
||||
public class ModelDependenciesBuilderImplTest extends AbstractModelBuilderTest {
|
||||
|
||||
public ModelDependenciesBuilderImplTest(@NotNull String gradleVersion) {
|
||||
super(gradleVersion);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultDependenciesModel() throws Exception {
|
||||
ModelDependenciesBuilderImpl dependenciesBuilder = new ModelDependenciesBuilderImpl();
|
||||
assertTrue(dependenciesBuilder.canBuild("org.jetbrains.plugins.gradle.model.ProjectDependenciesModel"));
|
||||
|
||||
DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getIdeaProject().getModules();
|
||||
|
||||
final int modulesSize = 3;
|
||||
@@ -76,9 +76,6 @@ public class ModelDependenciesBuilderImplTest extends AbstractModelBuilderTest {
|
||||
|
||||
@Test
|
||||
public void testGradleIdeaPluginPlusScopesDependenciesModel() throws Exception {
|
||||
ModelDependenciesBuilderImpl dependenciesBuilder = new ModelDependenciesBuilderImpl();
|
||||
assertTrue(dependenciesBuilder.canBuild("org.jetbrains.plugins.gradle.model.ProjectDependenciesModel"));
|
||||
|
||||
DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getIdeaProject().getModules();
|
||||
|
||||
final int modulesSize = 5;
|
||||
+6
-4
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.model.builder;
|
||||
package org.jetbrains.plugins.gradle.tooling.builder;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.util.Function;
|
||||
@@ -21,6 +21,7 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.gradle.tooling.model.DomainObjectSet;
|
||||
import org.gradle.tooling.model.idea.IdeaModule;
|
||||
import org.gradle.tooling.model.idea.IdeaSourceDirectory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.gradle.model.ExtIdeaContentRoot;
|
||||
import org.jetbrains.plugins.gradle.model.ModuleExtendedModel;
|
||||
import org.junit.Assert;
|
||||
@@ -43,13 +44,14 @@ import static org.junit.Assert.assertTrue;
|
||||
*/
|
||||
public class ModuleExtendedModelBuilderImplTest extends AbstractModelBuilderTest {
|
||||
|
||||
public ModuleExtendedModelBuilderImplTest(@NotNull String gradleVersion) {
|
||||
super(gradleVersion);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGradleSourcesSetsInterpretation() throws Exception {
|
||||
final int modulesSize = 7;
|
||||
|
||||
ModuleExtendedModelBuilderImpl moduleExtendedModelBuilder = new ModuleExtendedModelBuilderImpl();
|
||||
assertTrue(moduleExtendedModelBuilder.canBuild("org.jetbrains.plugins.gradle.model.ModuleExtendedModel"));
|
||||
|
||||
DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getIdeaProject().getModules();
|
||||
|
||||
List<ModuleExtendedModel> models =
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user