private void generateCompilerArtifacts()

in flex-maven-tools/flex-sdk-converter/converters/air/src/main/java/org/apache/flex/utilities/converter/air/AirConverter.java [76:154]


    private 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>();
        File[] compilerFiles = directory.listFiles(new AirCompilerFilter());
        if(compilerFiles != null) {
            files.addAll(Arrays.asList(compilerFiles));
        }

        // 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);
        }

        // Generate the common package (files from the bin directory)
        File binDir = new File(rootSourceDirectory, "bin");
        if (binDir.exists() && binDir.isDirectory()) {
            final File commonZip = new File(rootTargetDirectory,
                    "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion +
                            File.separator + "adt-" + airSdkVersion + "-common.zip");
            generateZip(binDir, commonZip, new FilenameFilter() {
                @Override
                public boolean accept(File dir, String name) {
                    return "adt".equals(name) || "adt.bat".equals(name) ||
                            "adl".equals(name) || "adl.exe".equals(name);
                }
            });
        }

        // Generate the android package (android directory)
        File androidDir = new File(directory, "android");
        if (androidDir.exists() && androidDir.isDirectory()) {
            final File androidZip = new File(rootTargetDirectory,
                    "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion +
                            File.separator + "adt-" + airSdkVersion + "-android.zip");
            generateZip(androidDir, androidZip);
        }

        // Generate the ios package (aot directory)
        File iosDir = new File(directory, "aot");
        if (iosDir.exists() && iosDir.isDirectory()) {
            final File iosZip = new File(rootTargetDirectory,
                    "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion +
                            File.separator + "adt-" + airSdkVersion + "-ios.zip");
            generateZip(iosDir, iosZip);
        }

        // Generate the exe, dmg, deb, rpm packages (nai directory)
        File desktopDir = new File(directory, "nai");
        if (desktopDir.exists() && desktopDir.isDirectory()) {
            final File desktopZip = new File(rootTargetDirectory,
                    "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion +
                            File.separator + "adt-" + airSdkVersion + "-desktop.zip");
            generateZip(desktopDir, desktopZip);
        }

        // Generate the windows packages (win directory)
        File windowsDir = new File(directory, "win");
        if (windowsDir.exists() && windowsDir.isDirectory()) {
            final File windowsZip = new File(rootTargetDirectory,
                    "com.adobe.air.compiler.adt.".replace(".", File.separator) + airSdkVersion +
                            File.separator + "adt-" + airSdkVersion + "-win.zip");
            generateZip(windowsDir, windowsZip);
        }

        // Write this artifact to file.
        writeArtifact(compiler);
    }