use of org.jetbrains.jps.android.model.JpsAndroidModuleExtension in project android by JetBrains.
the class AndroidPackagingBuildTarget method getOutputRoots.
@NotNull
@Override
public Collection<File> getOutputRoots(CompileContext context) {
final File moduleOutputDir = ProjectPaths.getModuleOutputDir(myModule, false);
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(myModule);
if (moduleOutputDir == null || extension == null) {
return Collections.emptyList();
}
final String outputPath = AndroidJpsUtil.getApkPath(extension, moduleOutputDir);
if (outputPath == null) {
return Collections.emptyList();
}
return Collections.singletonList(new File(outputPath));
}
use of org.jetbrains.jps.android.model.JpsAndroidModuleExtension 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.model.JpsAndroidModuleExtension 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.android.model.JpsAndroidModuleExtension in project android by JetBrains.
the class AndroidResourcePackagingBuildTarget method writeConfiguration.
@Override
public void writeConfiguration(ProjectDescriptor pd, PrintWriter out) {
final JpsAndroidModuleExtension extension = AndroidJpsUtil.getExtension(myModule);
assert extension != null;
if (extension.isUseCustomManifestPackage()) {
out.println(extension.getCustomManifestPackage());
}
out.println(extension.getAdditionalPackagingCommandLineParameters());
}
use of org.jetbrains.jps.android.model.JpsAndroidModuleExtension in project android by JetBrains.
the class AndroidResourcePackagingBuildTarget method fillDependencies.
@Override
protected void fillDependencies(List<BuildTarget<?>> result) {
super.fillDependencies(result);
result.add(new AndroidResourceCachingBuildTarget(myModule));
for (JpsAndroidModuleExtension depExtension : AndroidJpsUtil.getAllAndroidDependencies(myModule, true)) {
result.add(new AndroidResourceCachingBuildTarget(depExtension.getModule()));
}
}
Aggregations