All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.guyi.ipojo.compile.lib.expand.manifest.defaults.BaseManifestExpand Maven / Gradle / Ivy

The newest version!
package tech.guyi.ipojo.compile.lib.expand.manifest.defaults;

import javassist.ClassPool;
import tech.guyi.ipojo.compile.lib.compile.entry.CompileClass;
import tech.guyi.ipojo.compile.lib.configuration.Compile;
import tech.guyi.ipojo.compile.lib.expand.manifest.ManifestExpand;
import tech.guyi.ipojo.compile.lib.expand.manifest.entry.Manifest;

import java.util.*;

public class BaseManifestExpand implements ManifestExpand {

    @Override
    public List execute(ClassPool pool, Set components, Compile compile) {
        String version = compile.getProject().getVersion();
        version = version.endsWith("-SNAPSHOT") ? version.replace("-SNAPSHOT","") : version;
        return Arrays.asList(
                new Manifest("Manifest-Version","1.0"),
                new Manifest("Bundle-ManifestVersion","2"),
                new Manifest("Bundle-Name", compile.getName()),
                new Manifest("Bundle-SymbolicName",compile.getSymbolicName()),
                new Manifest("Bundle-Version", version),
                new Manifest("Private-Package",compile.getPackageName())
        );
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy