use of org.jetbrains.jps.model.module.JpsModule in project intellij-elixir by KronicDeth.
the class ElixirTarget method computeDependencies.
public Collection<BuildTarget<?>> computeDependencies() {
List<BuildTarget<?>> dependencies = new ArrayList<BuildTarget<?>>();
Set<JpsModule> modules = JpsJavaExtensionService.dependencies(myModule).includedIn(JpsJavaClasspathKind.compile(isTests())).getModules();
for (JpsModule module : modules) {
if (module.getModuleType().equals(JpsElixirModuleType.INSTANCE)) {
dependencies.add(new ElixirTarget(getElixirTargetType(), module));
}
}
if (isTests()) {
dependencies.add(new ElixirTarget(ElixirTargetType.PRODUCTION, myModule));
}
return dependencies;
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-elixir by KronicDeth.
the class MixBuilder method build.
@Override
public void build(@NotNull ElixirTarget target, @NotNull DirtyFilesHolder<ElixirSourceRootDescriptor, ElixirTarget> holder, @NotNull BuildOutputConsumer outputConsumer, @NotNull CompileContext context) throws ProjectBuildException, IOException {
if (!holder.hasDirtyFiles() && !holder.hasRemovedFiles())
return;
JpsModule module = target.getModule();
JpsProject project = module.getProject();
ElixirCompilerOptions compilerOptions = JpsElixirCompilerOptionsExtension.getOrCreateExtension(project).getOptions();
if (!compilerOptions.myUseMixCompiler)
return;
String mixPath = getMixExecutablePath(project);
if (mixPath == null) {
String errorMessage = "Mix path is not set.";
context.processMessage(new CompilerMessage(NAME, BuildMessage.Kind.ERROR, errorMessage));
throw new ProjectBuildException(errorMessage);
}
JpsSdk<JpsDummyElement> sdk = ElixirTargetBuilderUtil.getSdk(context, module);
String elixirPath = JpsElixirSdkType.getScriptInterpreterExecutable(sdk.getHomePath()).getAbsolutePath();
for (String contentRootUrl : module.getContentRootsList().getUrls()) {
String contentRootPath = new URL(contentRootUrl).getPath();
File contentRootDir = new File(contentRootPath);
File mixConfigFile = new File(contentRootDir, MIX_CONFIG_FILE_NAME);
if (!mixConfigFile.exists())
continue;
runMix(elixirPath, mixPath, contentRootPath, compilerOptions.myAttachDebugInfoEnabled, context);
}
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class DependencyResolvingBuilder method getRepositoryLibraries.
@NotNull
private static Collection<JpsTypedLibrary<JpsSimpleElement<RepositoryLibraryDescriptor>>> getRepositoryLibraries(ModuleChunk chunk) {
final Collection<JpsTypedLibrary<JpsSimpleElement<RepositoryLibraryDescriptor>>> result = new SmartHashSet<>();
for (JpsModule module : chunk.getModules()) {
for (JpsDependencyElement dep : module.getDependenciesList().getDependencies()) {
if (dep instanceof JpsLibraryDependency) {
final JpsLibrary _lib = ((JpsLibraryDependency) dep).getLibrary();
final JpsTypedLibrary<JpsSimpleElement<RepositoryLibraryDescriptor>> lib = _lib != null ? _lib.asTyped(JpsMavenRepositoryLibraryType.INSTANCE) : null;
if (lib != null) {
result.add(lib);
}
}
}
}
return result;
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class FormsBuilderTest method testDoNotCopyRuntimeClassesIfOnlyAlienFormFilesExist.
public void testDoNotCopyRuntimeClassesIfOnlyAlienFormFilesExist() {
JpsModule module = addModule("m", copyToProject("plugins/ui-designer/jps-plugin/testData/build/alienFormFile", "src"));
buildAllModules().assertSuccessful();
assertFalse(isRuntimeClassesCopied(module));
}
use of org.jetbrains.jps.model.module.JpsModule in project intellij-community by JetBrains.
the class FormsBuilderTest method testSimple.
public void testSimple() {
JpsModule m = addModule("m", copyToProject(SIMPLE_FORM_PATH, "src"));
buildAllModules().assertSuccessful();
assertTrue(isRuntimeClassesCopied(m));
assertInstrumented(m, "xxx/MyForm.class");
buildAllModules().assertUpToDate();
}
Aggregations