Package com.redhat.ceylon.cmr.api

Examples of com.redhat.ceylon.cmr.api.RepositoryManager


        for(File src : sourceFolders){
            builder.addSrcDirectory(src);
        }
       
        // set up the artifact repository
        RepositoryManager repository = getRepositoryManager();
       
        builder.setRepositoryManager(repository);
       
        // make a destination repo
        outputRepositoryManager = getOutputRepositoryManager();
View Full Code Here


            throw new RuntimeException(x);
        }
    }
   
    protected void verifyRuntimeClassLoading(RunnableTest test) {
        RepositoryManager repoManager = CeylonUtils.repoManager()
                .buildManager();
        VFS vfs = new VFS();
        com.redhat.ceylon.compiler.typechecker.context.Context context = new com.redhat.ceylon.compiler.typechecker.context.Context(repoManager, vfs);
        RuntimeModuleManager moduleManager = new RuntimeModuleManager(context);
        moduleManager.initCoreModules();
        moduleManager.loadModule(AbstractModelLoader.CEYLON_LANGUAGE, Versions.CEYLON_VERSION_NUMBER, repoManager.getArtifactResult("ceylon.language", Versions.CEYLON_VERSION_NUMBER),
                getClass().getClassLoader());
        RuntimeModelLoader modelLoader = moduleManager.getModelLoader();
        modelLoader.setupWithNoStandardModules();
        modelLoader.loadStandardModules();
        test.test(modelLoader);
View Full Code Here

        return jdkModules;
    }

    // Publish the JAR to the specified or default output repository
    public void publish() {
        RepositoryManager outputRepository = getOutputRepositoryManager();

        ArtifactContext context = new ArtifactContext(module.getName(), module.getVersion(), ArtifactContext.JAR);
        context.setForceOperation(true);
        ArtifactContext descriptorContext = null;
        if (descriptor != null) {
            if (descriptor.toString().toLowerCase().endsWith(".xml")) {
                descriptorContext = new ArtifactContext(module.getName(), module.getVersion(), ArtifactContext.MODULE_XML);
            } else if (descriptor.toString().toLowerCase().endsWith(".properties")) {
                descriptorContext = new ArtifactContext(module.getName(), module.getVersion(), ArtifactContext.MODULE_PROPERTIES);
            }
            descriptorContext.setForceOperation(true);
        }
        try{
            File jarFile = applyCwd(this.jarFile);
            outputRepository.putArtifact(context, jarFile);
            signArtifact(context, jarFile);
           
            if (descriptorContext != null) {
                outputRepository.putArtifact(descriptorContext, applyCwd(descriptor));
            }
        }catch(CMRException x){
            throw new ImportJarException("error.failedWriteArtifact", new Object[]{context, x.getLocalizedMessage()}, x);
        }catch(Exception x){
            // FIXME: remove when the whole CMR is using CMRException
View Full Code Here

    private boolean isVerbose(String key) {
        return verbose || options.get(OptionName.VERBOSE + ":" + key) != null;
    }

    public void addOutputModuleToClassPath(Module module){
        RepositoryManager repositoryManager = fileManager.getOutputRepositoryManager();
        ArtifactResult artifact = null;
        try {
            ArtifactContext ctx = new ArtifactContext(module.getNameAsString(), module.getVersion(), ArtifactContext.CAR, ArtifactContext.JAR);
            artifact = repositoryManager.getArtifactResult(ctx);
        } catch (InvalidArchiveException e) {
            log.error("ceylon", "Module car " + e.getPath()
                    +" obtained from repository " + e.getRepository()
                    +" has an invalid SHA1 signature: you need to remove it and rebuild the archive, since it"
                    +" may be corrupted.");
View Full Code Here

            FileUtil.delete(dir);
        }
        dir.mkdirs();

        // download a required jar
        RepositoryManager repoManager = CeylonUtils.repoManager().buildManager();
        File undertowCoreModule = repoManager.getArtifact(new ArtifactContext("io.undertow.core", "1.0.0.Beta20", ".jar"));
        File languageModule = repoManager.getArtifact(new ArtifactContext(AbstractModelLoader.CEYLON_LANGUAGE, TypeChecker.LANGUAGE_MODULE_VERSION, ".car"));

        // fire up the java compiler
        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        assertNotNull("Missing Java compiler, this test is probably being run with a JRE instead of a JDK!", compiler);
        List<String> options = Arrays.asList("-sourcepath", "../ceylon-sdk/source", "-d", dir.getAbsolutePath(),
View Full Code Here

        File file = new File("test/src", name);
        if (!file.exists()) {
            throw new RuntimeException("Unable to find resource " + name);
        }
        RepositoryManagerBuilder builder = new RepositoryManagerBuilder(new NullLogger(), false, 20000);
        RepositoryManager repoManager = builder.buildRepository();
        VFS vfs = new VFS();
        Context context = new Context(repoManager, vfs);
        PhasedUnits pus = new PhasedUnits(context);
        // Make the module manager think we're looking at this package
        // even though there's no module descriptor
View Full Code Here

*
* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
*/
public class JBossRuntime extends AbstractJBossRuntime {
    protected ModuleLoader createModuleLoader(Configuration conf) throws Exception {
        RepositoryManager repository = createRepository(conf);
        return new CeylonModuleLoader(repository);
    }
View Full Code Here

            throw cre;
        }
    }

    private Set<String> getVersions(String name, Configuration conf, boolean offline) {
        RepositoryManager repoman = createRepository(conf, offline);
        ModuleVersionQuery query = new ModuleVersionQuery(name, null, ModuleQuery.Type.JVM);
        query.setBinaryMajor(Versions.JVM_BINARY_MAJOR_VERSION);
        ModuleVersionResult result = repoman.completeVersions(query);
        NavigableMap<String, ModuleVersionDetails> versionMap = result.getVersions();
        return versionMap.keySet();
    }
View Full Code Here

            public void debug(String str) {
                System.err.println("DEBUG: "+str);
            }
           
        }, false, (int)com.redhat.ceylon.common.Constants.DEFAULT_TIMEOUT);
        RepositoryManager repoManager = builder.buildRepository();
        VFS vfs = new VFS();
        Context context = new Context(repoManager, vfs);
        moduleManager = new RuntimeModuleManager(context);
        moduleManager.initCoreModules();
        moduleManager.prepareForTypeChecking();
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.cmr.api.RepositoryManager

Copyright © 2018 www.massapicom. 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.