use of org.jetbrains.jps.builders.impl.BuildRootDescriptorImpl in project android by JetBrains.
the class AndroidResourceCachingBuildTarget method doComputeRootDescriptors.
@NotNull
@Override
protected List<BuildRootDescriptor> doComputeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(myModule);
if (extension != null) {
final List<BuildRootDescriptor> result = new ArrayList<BuildRootDescriptor>();
for (File resOverlayDir : extension.getResourceOverlayDirs()) {
result.add(new BuildRootDescriptorImpl(this, resOverlayDir));
}
final File resourceDir = AndroidJpsUtil.getResourceDirForCompilationPath(extension);
if (resourceDir != null) {
result.add(new BuildRootDescriptorImpl(this, resourceDir));
}
if (!extension.isLibrary()) {
final Set<String> aarResDirPaths = new HashSet<String>();
AndroidJpsUtil.collectResDirectoriesFromAarDeps(myModule, aarResDirPaths);
for (JpsAndroidModuleExtension depExtension : AndroidJpsUtil.getAllAndroidDependencies(myModule, true)) {
AndroidJpsUtil.collectResDirectoriesFromAarDeps(depExtension.getModule(), aarResDirPaths);
}
for (String path : aarResDirPaths) {
result.add(new BuildRootDescriptorImpl(this, new File(path)));
}
}
return result;
}
return Collections.emptyList();
}
use of org.jetbrains.jps.builders.impl.BuildRootDescriptorImpl in project intellij-plugins by JetBrains.
the class OsmorcBuildTarget method computeRootDescriptors.
@NotNull
@Override
public List<BuildRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
List<BuildRootDescriptor> rootDescriptors = ContainerUtil.newArrayList();
JpsOsmorcModuleExtension extension = JpsOsmorcExtensionService.getExtension(getModule());
if (extension != null) {
File file = extension.getBundleDescriptorFile();
if (file != null) {
rootDescriptors.add(new BuildRootDescriptorImpl(this, file, true));
}
}
JpsJavaExtensionService.dependencies(getModule()).recursively().productionOnly().processModules(module -> {
if (module == getModule() || JpsOsmorcExtensionService.getExtension(module) == null) {
File root = JpsJavaExtensionService.getInstance().getOutputDirectory(myModule, false);
if (root != null) {
rootDescriptors.add(new BuildRootDescriptorImpl(this, root, true));
}
}
});
return rootDescriptors;
}
use of org.jetbrains.jps.builders.impl.BuildRootDescriptorImpl in project android by JetBrains.
the class AndroidAarDepsBuildTarget method doComputeRootDescriptors.
@NotNull
@Override
protected List<BuildRootDescriptor> doComputeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
final Set<JpsLibrary> libraries = JpsJavaExtensionService.getInstance().enumerateDependencies(Collections.singleton(myModule)).runtimeOnly().productionOnly().getLibraries();
final List<BuildRootDescriptor> result = new ArrayList<BuildRootDescriptor>();
for (JpsLibrary library : libraries) {
final Pair<File, List<File>> pair = AndroidJpsUtil.getResDirAndJarsIfAar(library);
final List<File> jars = pair != null ? pair.getSecond() : null;
if (jars != null) {
for (File jar : jars) {
result.add(new BuildRootDescriptorImpl(this, jar));
}
}
}
return result;
}
use of org.jetbrains.jps.builders.impl.BuildRootDescriptorImpl in project android by JetBrains.
the class AndroidPackagingBuildTarget method doComputeRootDescriptors.
@NotNull
@Override
protected List<BuildRootDescriptor> doComputeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
final File resPackage = AndroidResourcePackagingBuildTarget.getOutputFile(dataPaths, myModule);
final File classesDexFile = AndroidDexBuildTarget.getOutputFile(dataPaths, myModule);
final List<BuildRootDescriptor> roots = new ArrayList<BuildRootDescriptor>();
roots.add(new BuildRootDescriptorImpl(this, resPackage));
roots.add(new BuildRootDescriptorImpl(this, classesDexFile));
final AndroidPlatform platform = AndroidJpsUtil.getAndroidPlatform(myModule, null, null);
if (platform != null) {
for (String jarOrLibDir : AndroidJpsUtil.getExternalLibraries(dataPaths, myModule, platform, false, true, false)) {
roots.add(new BuildRootDescriptorImpl(this, new File(jarOrLibDir), false));
}
}
for (File resourceRoot : AndroidJpsUtil.getJavaOutputRootsForModuleAndDependencies(myModule)) {
roots.add(new MyResourceRootDescriptor(this, resourceRoot));
}
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(myModule);
assert extension != null;
for (String nativeLibDir : collectNativeLibsFolders(extension, false)) {
roots.add(new BuildRootDescriptorImpl(this, new File(nativeLibDir)));
}
return roots;
}
use of org.jetbrains.jps.builders.impl.BuildRootDescriptorImpl in project android by JetBrains.
the class AndroidResourcePackagingBuildTarget method doComputeRootDescriptors.
@NotNull
@Override
protected List<BuildRootDescriptor> doComputeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(myModule);
assert extension != null;
final String[] resourceDirs = AndroidJpsUtil.collectResourceDirsForCompilation(extension, true, dataPaths, false);
final List<String> assertDirs = new ArrayList<String>();
collectAssetDirs(extension, assertDirs, false);
final File manifestFile = AndroidJpsUtil.getPreprocessedManifestFile(extension, dataPaths);
final List<BuildRootDescriptor> result = new ArrayList<BuildRootDescriptor>();
for (String resourceDir : resourceDirs) {
result.add(new BuildRootDescriptorImpl(this, new File(resourceDir)));
}
for (String assetDir : assertDirs) {
result.add(new BuildRootDescriptorImpl(this, new File(assetDir)));
}
if (manifestFile != null) {
result.add(new BuildRootDescriptorImpl(this, manifestFile));
}
return result;
}
Aggregations