archive.glue
Glues instrumental.archive to to instrumental.compile, enabling in-memory archives as dependencies
Allows archives (produced by instrumental.archive) to be used as dependencies for instrumental.compile
Examples
Use an in-memory archive as dependency when compiling, first compile api then compile imp:
Archive api, imp; api = compiling() .versionAt(RELEASE_8) .source( from( "package com.acme.api; \n" + "public interface Greet { \n" + " public abstract String greeting(String to); \n" + "}\n") ) .compile(toArchive()) .configured(asJar()) .toObjectModel(); imp = compiling() .versionAt(RELEASE_8) .withDependencies(fromArchive(api)) .source( from( "package com.acme.imp; \n" + "import com.acme.api.Greet; \n" + "public class HelloService implements Greet { \n" + " @Override \n" + " public String greeting(String to) \n" + " { \n" + " return \"Hello \" + to; \n" + " } \n" + "}\n") ) .compile(toArchive()) .configured(asJar()) .toObjectModel(); assertThat(imp.content("com/acme/imp/HelloService.class").isPresent(), is(true));