use of org.jetbrains.jps.android.AndroidPlatform in project android by JetBrains.
the class AndroidPreDexBuildTarget method computeRootDescriptors.
@NotNull
@Override
public List<AndroidPreDexBuildTarget.MyRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
final List<AndroidPreDexBuildTarget.MyRootDescriptor> result = new ArrayList<AndroidPreDexBuildTarget.MyRootDescriptor>();
final Set<JpsModule> libModules = new HashSet<JpsModule>();
final Set<String> externalJars = new HashSet<String>();
for (JpsModule module : myProject.getModules()) {
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(module);
if (extension != null && !extension.isLibrary() && extension.isPreDexingEnabled()) {
final AndroidPlatform platform = AndroidJpsUtil.getAndroidPlatform(module, null, null);
if (platform != null) {
fillDepsRecursively(module, libModules, externalJars, dataPaths, platform);
}
}
}
for (JpsModule libModule : libModules) {
final File classesJarFile = new AndroidLibraryPackagingTarget(libModule).getOutputFile(dataPaths);
result.add(new MyRootDescriptor(this, classesJarFile, libModule.getName()));
}
for (String externalJarPath : externalJars) {
result.add(new MyRootDescriptor(this, new File(externalJarPath), null));
}
return result;
}
use of org.jetbrains.jps.android.AndroidPlatform 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;
}
Aggregations