use of org.jetbrains.jps.incremental.ModuleBuildTarget in project intellij-community by JetBrains.
the class BuildTargetConfiguration method isTargetDirty.
public boolean isTargetDirty(CompileContext context) {
final String currentState = getCurrentState(context);
if (!currentState.equals(myConfiguration)) {
LOG.debug(myTarget + " configuration was changed:");
LOG.debug("Old:");
LOG.debug(myConfiguration);
LOG.debug("New:");
LOG.debug(currentState);
LOG.debug(myTarget + " will be recompiled");
if (myTarget instanceof ModuleBuildTarget) {
final JpsModule module = ((ModuleBuildTarget) myTarget).getModule();
synchronized (MODULES_WITH_TARGET_CONFIG_CHANGED_KEY) {
Set<JpsModule> modules = MODULES_WITH_TARGET_CONFIG_CHANGED_KEY.get(context);
if (modules == null) {
MODULES_WITH_TARGET_CONFIG_CHANGED_KEY.set(context, modules = new THashSet<>());
}
modules.add(module);
}
}
return true;
}
return false;
}
use of org.jetbrains.jps.incremental.ModuleBuildTarget in project intellij-community by JetBrains.
the class CheckResourcesTarget method computeDependencies.
@Override
public Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry, TargetOutputIndex outputIndex) {
List<BuildTarget<?>> result = new ArrayList<>();
ModuleBuildTarget compileTarget = new ModuleBuildTarget(myModule, JavaModuleBuildTargetType.getInstance(isTests()));
result.add(compileTarget);
for (BuildTarget<?> dep : compileTarget.computeDependencies(targetRegistry, outputIndex)) {
if (dep instanceof ModuleBuildTarget) {
result.add(new CheckResourcesTarget(((ModuleBuildTarget) dep).getModule(), ((ModuleBuildTarget) dep).isTests() ? TESTS : PRODUCTION));
}
}
return result;
}
use of org.jetbrains.jps.incremental.ModuleBuildTarget in project intellij-community by JetBrains.
the class CompilingGroovycRunner method addStubRootsToJavacSourcePath.
private static void addStubRootsToJavacSourcePath(CompileContext context, Map<ModuleBuildTarget, String> generationOutputs) {
final BuildRootIndex rootsIndex = context.getProjectDescriptor().getBuildRootIndex();
for (ModuleBuildTarget target : generationOutputs.keySet()) {
File root = new File(generationOutputs.get(target));
rootsIndex.associateTempRoot(context, target, new JavaSourceRootDescriptor(root, target, true, true, "", Collections.<File>emptySet()));
}
}
use of org.jetbrains.jps.incremental.ModuleBuildTarget in project android by JetBrains.
the class AndroidBuildTarget method computeDependencies.
@Override
public Collection<BuildTarget<?>> computeDependencies(final BuildTargetRegistry registry, TargetOutputIndex outputIndex) {
final List<BuildTarget<?>> result = new ArrayList<BuildTarget<?>>(3);
fillDependencies(result);
result.add(new ModuleBuildTarget(myModule, JavaModuleBuildTargetType.PRODUCTION));
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(myModule);
if (extension != null && extension.isPackTestCode()) {
result.add(new ModuleBuildTarget(myModule, JavaModuleBuildTargetType.TEST));
}
return result;
}
use of org.jetbrains.jps.incremental.ModuleBuildTarget in project intellij-elixir by KronicDeth.
the class CompileScopeTestBuilder method module.
public CompileScopeTestBuilder module(JpsModule module) {
myTargets.add(new ModuleBuildTarget(module, JavaModuleBuildTargetType.PRODUCTION));
myTargets.add(new ModuleBuildTarget(module, JavaModuleBuildTargetType.TEST));
return this;
}
Aggregations