Examples of MavenArtifact


Examples of org.apache.flex.utilities.converter.model.MavenArtifact

     *
     * @throws ConverterException
     */
    protected void generateCompilerArtifacts() throws ConverterException {
        // Create the root artifact.
        final MavenArtifact compiler = new MavenArtifact();
        compiler.setGroupId("org.apache.flex");
        compiler.setArtifactId("compiler");
        compiler.setVersion(flexSdkVersion);
        compiler.setPackaging("pom");

        // Create a list of all libs that should belong to the Flex SDK compiler.
        final File directory = new File(rootSourceDirectory, "lib");
        if(!directory.exists() || !directory.isDirectory()) {
            throw new ConverterException("Compiler directory does not exist.");
        }
        final List<File> files = new ArrayList<File>();
        files.addAll(Arrays.asList(directory.listFiles(new FlexCompilerFilter())));

        // Add all jars in the "external" directory.
        final File externalDirectory = new File(directory, "external");
        if(externalDirectory.exists() && externalDirectory.isDirectory()) {
            files.addAll(Arrays.asList(externalDirectory.listFiles(new FlexCompilerFilter())));

            // Add all jars in the "external/optional" directory.
            final File optionalDirectory = new File(externalDirectory, "optional");
            if(optionalDirectory.exists() && optionalDirectory.isDirectory()) {
                files.addAll(Arrays.asList(optionalDirectory.listFiles(new FlexCompilerFilter())));
            }
        }

        // Generate artifacts for every jar in the input directories.
        for(final File sourceFile : files) {
            final MavenArtifact artifact = resolveArtifact(sourceFile, "org.apache.flex.compiler", flexSdkVersion);
            compiler.addDependency(artifact);
        }

        // Write this artifact to file.
        writeArtifact(compiler);
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

        generateFrameworkConfigurationArtifact();
    }

    protected void generateFrameworkArtifacts(File directory, String curGroupId) throws ConverterException {
        // Create the root artifact.
        final MavenArtifact framework = new MavenArtifact();
        framework.setGroupId(curGroupId);
        framework.setArtifactId("libs".equals(directory.getName()) ? "framework" : directory.getName());
        framework.setVersion(flexSdkVersion);
        framework.setPackaging("pom");

        final String artifactGroupId = framework.getGroupId() + "." + framework.getArtifactId();

        // Create a list of all libs that should belong to the Flex SDK framework.
        if(!directory.exists() || !directory.isDirectory()) {
            throw new ConverterException("Framework directory does not exist.");
        }
        final List<File> files = new ArrayList<File>();
        files.addAll(Arrays.asList(directory.listFiles(new FlexFrameworkFilter())));

        // Generate artifacts for every jar in the input directories.
        for(final File sourceFile : files) {
            // I think the experimental_mobile.swc belongs in the "mobile" package.
            if(!"libs".equals(directory.getName()) || !"experimental_mobile.swc".equals(sourceFile.getName())) {
                final MavenArtifact artifact = resolveArtifact(sourceFile, artifactGroupId, flexSdkVersion);
                framework.addDependency(artifact);
            }
        }

        // Forcefully add the mx library to the rest of the framework.
        if("libs".equals(directory.getName())) {
            final File mxSwc = new File(directory, "mx/mx.swc");
            final MavenArtifact artifact = resolveArtifact(mxSwc, artifactGroupId, flexSdkVersion);
            framework.addDependency(artifact);
        }

        // If we are in the "mobile" directory and the paren contains an "experimental_mobile.swc" file,
        // add this to the mobile package.
        if("mobile".equals(directory.getName())) {
            final File mobileExperimental = new File(directory.getParent(), "experimental_mobile.swc");
            if(mobileExperimental.exists()) {
                final MavenArtifact artifact = resolveArtifact(mobileExperimental, artifactGroupId, flexSdkVersion);
                framework.addDependency(artifact);
            }
        }
        // Write this artifact to file.
        writeArtifact(framework);
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

                    final File resourceDummyTargetFile = new File(
                            artifact.getBinaryTargetFile(rootTargetDirectory, MavenArtifact.DEFAULT_CLASSIFIER).getParent(),
                            artifact.getArtifactId() + "-" + artifact.getVersion() + ".rb.swc");
                    writeDummy(resourceDummyTargetFile);

                    final MavenArtifact resourceBundleDependency = new MavenArtifact();
                    resourceBundleDependency.setGroupId(artifact.getGroupId());
                    resourceBundleDependency.setArtifactId(artifact.getArtifactId());
                    resourceBundleDependency.setVersion(artifact.getVersion());
                    resourceBundleDependency.setPackaging("rb.swc");
                    artifact.addDependency(resourceBundleDependency);
                }
            }

            // Add source zips.
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

                        targetSwcFile = generateThemeSwc(themeDirectory);
                    }

                    if(targetSwcFile != null) {
                        // Generate the pom file.
                        final MavenArtifact themeArtifact = new MavenArtifact();
                        themeArtifact.setGroupId("org.apache.flex.framework.themes");
                        themeArtifact.setArtifactId(themeName);
                        themeArtifact.setVersion(flexSdkVersion);
                        themeArtifact.setPackaging("swc");
                        themeArtifact.addDefaultBinaryArtifact(targetSwcFile);

                        // In this case we don't want the resources to be copied.
                        super.writeArtifact(themeArtifact);
                    }
                }
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

        // Generate and Copy the SWC.
        final File targetSwcFile = generateThemeSwc(themeCssFile);

        if(targetSwcFile != null) {
            // Generate the pom file.
            final MavenArtifact themeArtifact = new MavenArtifact();
            themeArtifact.setGroupId("org.apache.flex.framework.themes");
            themeArtifact.setArtifactId(themeName);
            themeArtifact.setVersion(flexSdkVersion);
            themeArtifact.setPackaging("swc");
            themeArtifact.addDefaultBinaryArtifact(targetSwcFile);

            // In this case we don't want the resources to be copied.
            super.writeArtifact(themeArtifact);
        }
    }
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

     *
     * @throws ConverterException
     */
    protected void generateCompilerArtifacts() throws ConverterException {
        // Create the root artifact.
        final MavenArtifact compiler = new MavenArtifact();
        compiler.setGroupId("com.adobe.air");
        compiler.setArtifactId("compiler");
        compiler.setVersion(airSdkVersion);
        compiler.setPackaging("pom");

        // Create a list of all libs that should belong to the AIR SDK compiler.
        final File directory = new File(rootSourceDirectory, "lib");
        if(!directory.exists() || !directory.isDirectory()) {
            throw new ConverterException("Compiler directory does not exist.");
        }
        final List<File> files = new ArrayList<File>();
        files.addAll(Arrays.asList(directory.listFiles(new AirCompilerFilter())));

        // Generate artifacts for every jar in the input directories.
        for(final File sourceFile : files) {
            final MavenArtifact artifact = resolveArtifact(sourceFile, "com.adobe.air.compiler", airSdkVersion);
            compiler.addDependency(artifact);
        }

        // Write this artifact to file.
        writeArtifact(compiler);
View Full Code Here

Examples of org.drools.guvnor.client.rpc.MavenArtifact

    private Pair<Collection<MavenArtifact>, Collection<MavenArtifact>> build(final BufferedReader buffer) throws Exception {
        final Collection<MavenArtifact> dependencyTree = new ArrayList<MavenArtifact>();
        final Collection<MavenArtifact> dependencyList = new ArrayList<MavenArtifact>();

        final Stack<Pair<Integer, MavenArtifact>> stack = new Stack<Pair<Integer, MavenArtifact>>() {{
            push(new Pair<Integer, MavenArtifact>(Integer.MIN_VALUE, new MavenArtifact()));
        }};

        String strLine = null;
        while ((strLine = buffer.readLine()) != null) {
            if (Character.isLetterOrDigit(strLine.charAt(0))) {
                //should discard root element
                continue;
            }
            for (int index = 0; index < strLine.length(); index++) {
                if (Character.isLetterOrDigit(strLine.charAt(index))) {
                    final String artifactDefinition = extractArtifactDefinition(strLine.substring(index));
                    final MavenArtifact newArtifact = new MavenArtifact(artifactDefinition);
                    if (!newArtifact.isNecessaryOnRuntime()) {
                        break;
                    }
                    dependencyList.add(newArtifact);
                    if (index == stack.peek().getV1()) {
                        //same level
View Full Code Here

Examples of org.drools.guvnor.client.rpc.MavenArtifact

        final Collection<String> repositories = new ArrayList<String>() {{
            add(getURLtoLocalUserMavenRepo());
        }};

        final Collection<MavenArtifact> dependencies = new ArrayList<MavenArtifact>() {{
            add(new MavenArtifact("org.slf4j:slf4j-api:jar:1.6.4:compile"));
            add(new MavenArtifact("org.antlr:antlr-runtime:jar:3.3:compile"));
        }};

        buildCache(repositories, dependencies);
    }
View Full Code Here

Examples of org.drools.guvnor.client.rpc.MavenArtifact

        assertFalse(serviceConfig.equals(new ServiceConfig("70", excludedArtifacts, kbases)));
        assertFalse(serviceConfig.hashCode() == new ServiceConfig("70", excludedArtifacts, kbases).hashCode());

        serviceConfig = new ServiceConfig("70", excludedArtifacts, kbases);
        serviceConfig.removeExcludedArtifact(new MavenArtifact("org.drools:knowledge-api:jar:5.4.0-SNAPSHOT:compile"));
        assertFalse(serviceConfig.equals(new ServiceConfig("70", excludedArtifacts, kbases)));
        assertFalse(serviceConfig.hashCode() == new ServiceConfig("70", excludedArtifacts, kbases).hashCode());

        serviceConfig = new ServiceConfig("70", excludedArtifacts, kbases);
        serviceConfig.removeKBase("kbase2");
View Full Code Here

Examples of org.drools.guvnor.client.rpc.MavenArtifact

    @Test
    public void testAddRemoveExcludedArtifacts() {
        final ServiceConfig serviceConfig = new ServiceConfig(null, null, null);

        serviceConfig.addExcludedArtifact(new MavenArtifact("org.drools:knowledge-api:jar:5.4.0-SNAPSHOT:compile"));
        serviceConfig.addExcludedArtifact(new MavenArtifact("org.drools:knowledge-api:jar:5.4.0-SNAPSHOT:compile"));
        serviceConfig.addExcludedArtifact(null);
        assertEquals(1, serviceConfig.getExcludedArtifacts().size());

        serviceConfig.removeExcludedArtifact(new MavenArtifact("org.drools:knowledge-api:jar:5.4.0-SNAPSHOT:compile"));
        assertEquals(0, serviceConfig.getExcludedArtifacts().size());

        serviceConfig.setExcludedArtifacts(excludedArtifacts);
        serviceConfig.setExcludedArtifacts(null);
        assertEquals(2, serviceConfig.getExcludedArtifacts().size());

        serviceConfig.removeExcludedArtifact(new MavenArtifact("org.drools:knowledge-api:jar:5.4.0-SNAPSHOT:compile"));
        serviceConfig.removeExcludedArtifact(new MavenArtifact("org.drools:knowledge-aaaapi:jar:5.4.0-SNAPSHOT:compile"));
        serviceConfig.removeExcludedArtifact(null);
        assertEquals(1, serviceConfig.getExcludedArtifacts().size());

        serviceConfig.setExcludedArtifacts(new ArrayList<MavenArtifact>());
        assertEquals(0, serviceConfig.getExcludedArtifacts().size());

        serviceConfig.addExcludedArtifact(new MavenArtifact("org.drools:knowledge-aaaapi:jar:5.4.0-SNAPSHOT:compile"));
        serviceConfig.addExcludedArtifacts(excludedArtifacts);
        serviceConfig.addExcludedArtifacts(new ArrayList<MavenArtifact>());
        serviceConfig.addExcludedArtifacts(null);
        assertEquals(3, serviceConfig.getExcludedArtifacts().size());
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.