Java Code Examples for com.android.builder.model.AndroidLibrary#getManifest()

The following examples show how to use com.android.builder.model.AndroidLibrary#getManifest() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LintGradleProject.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
private LibraryProject(
        @NonNull LintGradleClient client,
        @NonNull File dir,
        @NonNull File referenceDir,
        @NonNull AndroidLibrary library) {
    super(client, dir, referenceDir, library.getManifest());
    mLibrary = library;

    // TODO: Make sure we don't use this project for any source library projects!
    mReportIssues = false;
}
 
Example 2
Source File: StandardizeLibManifestTask.java    From atlas with Apache License 2.0 2 votes vote down vote up
@TaskAction
public void preProcess() throws IOException, DocumentException, InterruptedException {

    AtlasDependencyTree dependencyTree = AtlasBuildContext.androidDependencyTrees.get(appVariantContext.getVariantName());
    androidLibraries = dependencyTree.getAllAndroidLibrarys();


    ExecutorServicesHelper executorServicesHelper = new ExecutorServicesHelper("StandardizeLibManifestTask",
                                                                               getLogger(), 0);
    List<Runnable> runnables = new ArrayList<>();

    ManifestInfo mainManifestFileObject = getManifestFileObject(mainManifestFile);

    appVariantContext.getModifyManifestDir().mkdirs();

    for (AndroidLibrary androidLibrary : androidLibraries) {

        File file = androidLibrary.getManifest();

        if (!file.exists()) {
            getLogger().error(androidLibrary.getResolvedCoordinates().toString() + " not has manifest : " + file
                .getAbsolutePath());
            return;
        }

        runnables.add(new Runnable() {

            @Override
            public void run() {
                try {

                    File modifyManifest = appVariantContext.getModifyManifest(androidLibrary);

                    //getLogger().error(file.getAbsolutePath() + " -> " + modifyManifest
                    //    .getAbsolutePath());

                    ManifestFileUtils.updatePreProcessManifestFile(modifyManifest, file, mainManifestFileObject,
                                                                   appVariantContext.getAtlasExtension().getTBuildConfig().isUpdateSdkVersion(), appVariantContext.getAtlasExtension()
                                                                       .getTBuildConfig().isIncremental());

                } catch (Throwable e) {
                    e.printStackTrace();
                    throw new GradleException("preprocess manifest failed " + file.getAbsolutePath(), e);
                }
            }

        });
    }

    executorServicesHelper.execute(runnables);

}