Package com.redhat.ceylon.cmr.api

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


                .optimize(true).generateSourceArchive(false)
                .addSrcDir(srcdir);
    }

    private TypeChecker typeChecker(Options opts) {
        final RepositoryManager repoman = CeylonUtils.repoManager()
                .userRepos(opts.getRepos())
                .outRepo(opts.getOutRepo())
                .buildManager();
        final TypeCheckerBuilder builder = new TypeCheckerBuilder()
            .moduleManagerFactory(new JsModuleManagerFactory("UTF-8"));
View Full Code Here


*/
public class MainForJsTest {
   
    public static void main(String[] args) throws Exception {
        final Options opts = new Options().addRepo("build/runtime").outRepo("build/test/proto");
        final RepositoryManager repoman = CeylonUtils.repoManager()
                .cwd(opts.getCwd())
                .systemRepo(opts.getSystemRepo())
                .userRepos(opts.getRepos())
                .outRepo(opts.getOutRepo())
                .buildManager();
View Full Code Here

        } else if (compileFlags.isEmpty()) {
            compileFlags = COMPILE_ONCE;
        }
       
        //Create a repository manager to load the js module we're going to run
        final RepositoryManager repoman = getRepositoryManager();
       
        version = checkModuleVersionsOrShowSuggestions(
                repoman, modname, version, ModuleQuery.Type.JS,
                Versions.JS_BINARY_MAJOR_VERSION, Versions.JS_BINARY_MINOR_VERSION, compileFlags);
        if (version == null) {
            return;
        }
        File jsmod = getArtifact(repoman, modname, version, false);
        // NB localRepos will contain a set of files pointing to the module repositories
        // where all the needed modules can be found
        List<File> localRepos = new ArrayList<>();
        for (Repository r : repoman.getRepositories()) {
            if (!r.getRoot().isRemote()) {
                File f = new File(r.getDisplayString());
                if (!localRepos.contains(f)) {
                    localRepos.add(f);
                }
View Full Code Here

        final TypeChecker typeChecker;
        if (opts.hasVerboseFlag("cmr")) {
            append("Using repositories: "+getRepositoryAsStrings());
            newline();
        }
        final RepositoryManager repoman = getRepositoryManager();
        long t0, t1, t2, t3, t4;
        final TypeCheckerBuilder tcb;
        List<File> onlySources = null;
        List<File> onlyResources = null;
        if (opts.isStdin()) {
View Full Code Here

    }

    private static void loadJsModel() {
        if (jstc == null) {
            System.out.println("Pass 2: Loading model from JS");
            final RepositoryManager repoman = CeylonUtils.repoManager()
                    .cwd(options.getCwd())
                    .systemRepo(options.getSystemRepo())
                    .userRepos(options.getRepos())
                    .outRepo(options.getOutRepo())
                    .buildManager();
View Full Code Here

                ArtifactResult artifact = null;
                if (alreadySearchedArtifacts.containsKey(module)) {
                    artifact = alreadySearchedArtifacts.get(module);
                } else {
                    //try and load the module from the repository
                    RepositoryManager repositoryManager = context.getRepositoryManager();
                    Exception exceptionOnGetArtifact = null;
                    ArtifactContext artifactContext = new ArtifactContext(module.getNameAsString(), module.getVersion(), getArtifactSuffixes(searchedArtifactExtensions));
                    listener.retrievingModuleArtifact(module, artifactContext);
                    try {
                        artifact = repositoryManager.getArtifactResult(artifactContext);
                    } catch (Exception e) {
                        exceptionOnGetArtifact = catchIfPossible(e);
                    }
                    if (artifact == null) {
                        //not there => error
View Full Code Here

    public void resolveModule(ArtifactResult artifact, Module module, ModuleImport moduleImport, LinkedList<Module> dependencyTree, List<PhasedUnits> phasedUnitsOfDependencies, boolean forCompiledModule) {
        //This implementation relies on the ability to read the model from source
        //the compiler for example subclasses this to read lazily and from the compiled model
        ArtifactContext artifactContext = new ArtifactContext(module.getNameAsString(), module.getVersion(), ArtifactContext.SRC);
        RepositoryManager repositoryManager = context.getRepositoryManager();
        Exception exceptionOnGetArtifact = null;
        ArtifactResult sourceArtifact = null;
        try {
            sourceArtifact = repositoryManager.getArtifactResult(artifactContext);
        } catch (Exception e) {
            exceptionOnGetArtifact = e;
        }
        if ( sourceArtifact == null ) {
            ModuleHelper.buildErrorOnMissingArtifact(artifactContext, module, moduleImport, dependencyTree, exceptionOnGetArtifact, this);
View Full Code Here

   
    private final Module moduleDescriptor;

    public ModuleDescriptorReader(String moduleName, File srcDir) throws NoSuchModuleException {
        RepositoryManagerBuilder builder = new RepositoryManagerBuilder(new NullLogger(), DefaultToolOptions.getDefaultOffline(), (int)DefaultToolOptions.getDefaultTimeout());
        RepositoryManager repoManager = builder.buildRepository();
        VFS vfs = new VFS();
        Context context = new Context(repoManager, vfs);
        PhasedUnits pus = new PhasedUnits(context);
        List<String> name = ModuleManager.splitModuleName(moduleName);
        ModuleManager moduleManager = pus.getModuleManager();
View Full Code Here

            // let's not check the version and assume it's provided
            // treat it as a missing optional for the purpose of classpath
            loadedModules.put(key, null);
            return;
        }
        RepositoryManager repositoryManager = getRepositoryManager();
        ArtifactContext artifactContext = new ArtifactContext(name, version, ArtifactContext.CAR, ArtifactContext.JAR);
        ArtifactResult result = repositoryManager.getArtifactResult(artifactContext);
        if(!optional
                && (result == null || result.artifact() == null || !result.artifact().exists())){
            String err = getModuleNotFoundErrorMessage(repositoryManager, name, version);
            errorAppend(err);
            errorNewline();
View Full Code Here

        boolean worked = false;
        switch(mode){
        case pack:
        {
            RepositoryManager outputRepositoryManager = getOutputRepositoryManager();
            for(ModuleSpec module : modules){
                worked |= addScripts(outputRepositoryManager, module, errorIfMissing);
            }
            break;
        }
        case install:
        {
            RepositoryManager repositoryManager = getRepositoryManager();
            for(ModuleSpec module : modules){
                worked |= installScripts(repositoryManager, module, errorIfMissing);
            }
            break;
        }
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.