Examples of Packager


Examples of com.android.builder.internal.packaging.Packager

                throw new SigningException("Failed to read key from keystore");
            }
        }

        try {
            Packager packager = new Packager(
                    outApkLocation, androidResPkgLocation, classesDexLocation,
                    certificateInfo, mCreatedBy, packagingOptions, mLogger);

            packager.setJniDebugMode(jniDebugBuild);

            // figure out conflicts!
            JavaResourceProcessor resProcessor = new JavaResourceProcessor(packager);

            if (javaResourcesLocation != null) {
                resProcessor.addSourceFolder(javaResourcesLocation);
            }

            // add the resources from the jar files.
            Set<String> hashs = Sets.newHashSet();

            for (File jar : packagedJars) {
                // TODO remove once we can properly add a library as a dependency of its test.
                String hash = getFileHash(jar);
                if (hash == null) {
                    throw new PackagerException("Unable to compute hash of " + jar.getAbsolutePath());
                }
                if (hashs.contains(hash)) {
                    continue;
                }

                hashs.add(hash);

                packager.addResourcesFromJar(jar);
            }

            // also add resources from library projects and jars
            if (jniLibsFolders != null) {
                for (File jniFolder : jniLibsFolders) {
                    if (jniFolder.isDirectory()) {
                        packager.addNativeLibraries(jniFolder, abiFilters);
                    }
                }
            }

            packager.sealApk();
        } catch (SealedPackageException e) {
            // shouldn't happen since we control the package from start to end.
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of com.android.builder.internal.packaging.Packager

                throw new SigningException("Failed to read key from keystore");
            }
        }

        try {
            Packager packager = new Packager(
                    outApkLocation, androidResPkgLocation, classesDexLocation,
                    certificateInfo, mCreatedBy, mLogger);

            packager.setJniDebugMode(jniDebugBuild);

            // figure out conflicts!
            JavaResourceProcessor resProcessor = new JavaResourceProcessor(packager);

            if (javaResourcesLocation != null) {
                resProcessor.addSourceFolder(javaResourcesLocation);
            }

            // add the resources from the jar files.
            for (File jar : packagedJars) {
                packager.addResourcesFromJar(jar);
            }

            // also add resources from library projects and jars
            if (jniLibsLocation != null) {
                packager.addNativeLibraries(jniLibsLocation);
            }

            packager.sealApk();
        } catch (SealedPackageException e) {
            // shouldn't happen since we control the package from start to end.
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of com.android.builder.internal.packaging.Packager

                throw new SigningException("Failed to read key from keystore");
            }
        }

        try {
            Packager packager = new Packager(
                    outApkLocation, androidResPkgLocation, classesDexLocation,
                    certificateInfo, mCreatedBy, mLogger);

            packager.setJniDebugMode(jniDebugBuild);

            // figure out conflicts!
            JavaResourceProcessor resProcessor = new JavaResourceProcessor(packager);

            if (javaResourcesLocation != null) {
                resProcessor.addSourceFolder(javaResourcesLocation);
            }

            // add the resources from the jar files.
            for (File jar : packagedJars) {
                packager.addResourcesFromJar(jar);
            }

            // also add resources from library projects and jars
            if (jniLibsLocation != null) {
                packager.addNativeLibraries(jniLibsLocation);
            }

            packager.sealApk();
        } catch (SealedPackageException e) {
            // shouldn't happen since we control the package from start to end.
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of com.android.builder.packaging.Packager

            // this shouldn't happen as we have checked ahead of calling getDebugKey.
            throw new RuntimeException(e);
        }

        try {
            Packager packager = new Packager(
                    outApkLocation, androidResPkgLocation, classesDexLocation,
                    signingInfo, mLogger);

            packager.setDebugJniMode(buildType.isDebugJniBuild());

            // figure out conflicts!
            JavaResourceProcessor resProcessor = new JavaResourceProcessor(packager);

            if (mVariant.getBuildTypeSourceSet() != null) {
                Set<File> buildTypeJavaResLocations =
                        mVariant.getBuildTypeSourceSet().getJavaResources();
                for (File buildTypeJavaResLocation : buildTypeJavaResLocations) {
                    if (buildTypeJavaResLocation != null &&
                            buildTypeJavaResLocation.isDirectory()) {
                        resProcessor.addSourceFolder(buildTypeJavaResLocation.getAbsolutePath());
                    }
                }
            }

            for (SourceSet sourceSet : mVariant.getFlavorSourceSets()) {

                Set<File> flavorJavaResLocations = sourceSet.getJavaResources();
                for (File flavorJavaResLocation : flavorJavaResLocations) {
                    if (flavorJavaResLocation != null && flavorJavaResLocation.isDirectory()) {
                        resProcessor.addSourceFolder(flavorJavaResLocation.getAbsolutePath());
                    }
                }
            }

            Set<File> mainJavaResLocations = mVariant.getDefaultSourceSet().getJavaResources();
            for (File mainJavaResLocation : mainJavaResLocations) {
                if (mainJavaResLocation != null && mainJavaResLocation.isDirectory()) {
                    resProcessor.addSourceFolder(mainJavaResLocation.getAbsolutePath());
                }
            }

            // add the resources from the jar files.
            List<JarDependency> jars = mVariant.getJars();
            if (jars != null) {
                for (JarDependency jar : jars) {
                    packager.addResourcesFromJar(new File(jar.getLocation()));
                }
            }

            // add the resources from the libs jar files
            List<AndroidDependency> libs = mVariant.getDirectLibraries();
            addLibJavaResourcesToPackager(packager, libs);

            // also add resources from library projects and jars
            if (jniLibsLocation != null) {
                packager.addNativeLibraries(jniLibsLocation);
            }

            packager.sealApk();
        } catch (PackagerException e) {
            throw new RuntimeException(e);
        } catch (SealedPackageException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of com.android.builder.packaging.Packager

            // this shouldn't happen as we have checked ahead of calling getDebugKey.
            throw new RuntimeException(e);
        }

        try {
            Packager packager = new Packager(
                    outApkLocation, androidResPkgLocation, classesDexLocation,
                    signingInfo, mLogger);

            packager.setDebugJniMode(buildType.isDebugJniBuild());

            // figure out conflicts!
            JavaResourceProcessor resProcessor = new JavaResourceProcessor(packager);

            if (javaResourcesLocation != null) {
                resProcessor.addSourceFolder(javaResourcesLocation);
            }

            // add the resources from the jar files.
            Collection<JarDependency> jars = mVariant.getJars();
            if (jars != null) {
                for (JarDependency jar : jars) {
                    packager.addResourcesFromJar(new File(jar.getLocation()));
                }
            }

            // add the resources from the libs jar files
            List<AndroidDependency> libs = mVariant.getAllLibraries();

            for (AndroidDependency lib : libs) {
                packager.addResourcesFromJar(lib.getJarFile());
            }

            // also add resources from library projects and jars
            if (jniLibsLocation != null) {
                packager.addNativeLibraries(jniLibsLocation);
            }

            packager.sealApk();
        } catch (PackagerException e) {
            throw new RuntimeException(e);
        } catch (SealedPackageException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of com.volantis.mcs.runtime.packagers.Packager

            new MultipartPackageHandler();
        ApplicationContext applicationContext = new ApplicationContext(testRequestContext);
        applicationContext.setAssetURLRewriter(handler);
        PackageResources packageResources = new MultipartApplicationContext(testRequestContext);
        applicationContext.setPackageResources(packageResources);
        Packager packager = new MultipartPackageHandler();
        applicationContext.setPackager(packager);

        MarinerPageContext context = new MarinerPageContext();
        testRequestContext.setMarinerPageContext(context);
View Full Code Here

Examples of com.volantis.mcs.runtime.packagers.Packager

            new MultipartPackageHandler();
        ApplicationContext applicationContext = new ApplicationContext(testRequestContext);
        applicationContext.setAssetURLRewriter(handler);
        PackageResources packageResources = new MultipartApplicationContext(testRequestContext);
        applicationContext.setPackageResources(packageResources);
        Packager packager = new MultipartPackageHandler();
        applicationContext.setPackager(packager);

        MarinerPageContext context = new MarinerPageContext();
        testRequestContext.setMarinerPageContext(context);
View Full Code Here

Examples of com.volantis.mcs.runtime.packagers.Packager

    private void packagePage(Object bodyContext)
        throws IOException, ProtocolException {
        MarinerRequestContext requestContext = context.getRequestContext();
        ApplicationContext ac =
            ContextInternals.getApplicationContext(requestContext);
        Packager packager = ac.getPackager();

        if (packager != null) {
            try {
                packager.createPackage(requestContext, this, bodyContext);
            } catch (PackagingException e) {
                Throwable cause = e.getCause();

                if (cause instanceof IOException) {
                    throw (IOException)cause;
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

     * @see de.tuclausthal.informatik.winf.mobileagents.p2p.P2PNetwork#sendAgent(de.tuclausthal.informatik.winf.mobileagents.p2p.Node, de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo)
     */
  @Override
    public boolean sendAgent(Node toNode, AgentInfo agent)
    {
        Packager p = PackagingManager.getInstance().getPackager("StateOnly");
        byte[] data = p.packageAgent(agent);
        String path = fh.packInFile(data);
        po.ServSendFile(po.PurpleAccountGetConnection(account), toNode.getNodeName(), path);
        // TODO delete agent file?
        return true;
    }
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.packaging.Packager

     * @see #REPLY_OK
     */
    protected int deliverAgent(byte[] data, Node from)
    {
        // unpackage
        Packager p = PackagingManager.getInstance().getPackager("StateOnly");
        AgentInfo info = p.unpackageAgent(data);
        if (info == null)
        {
            return this.REPLY_ERROR;
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.