#!/home/nick/bin/feather2 library /home/nick/projects/metabuild/build/libs/metabuild-0.1.jar import uk.co.nickthecoder.metabuild.* class FeatherMetaBuild : MetaBuild() { val group = "uk.co.nickthecoder" val version="2.1.7" val gitLabProjectID = "60506750" val antlrVersion = "4.13.1" val asmVersion = "7.3.1" val junitVersion = "4.11" val xbeanVersion = "4.18" val foocadVersion = "2.0" val tokenName = "gitLabPrivateToken" meth build() { installGradle() publish(group, version) repositories( MavenCentral(), gitLabRepository( "foocad", "16890879" ) ) // ==== runtime ==== val runtime = project( "feather2-runtime" ).apply { javaLibrary().apply { testImplementation("junit:junit:$junitVersion") } publishing().apply { publishToGitLab( gitLabProjectID, tokenName ) } } // ==== grammar==== val grammar = project( "feather2-grammar" ).apply { javaLibrary().apply { // For parsing feather scripts. implementation( "org.antlr:antlr4-runtime:$antlrVersion" ) // For generating java byte code. implementation( "org.ow2.asm:asm:$asmVersion" ) } publishing().apply { publishToGitLab( gitLabProjectID, tokenName ) } } // ==== java examples ==== val javaexamples = project( "feather2-javaexamples" ).apply { javaLibrary().apply { implementation( runtime ) } } // ==== core ==== val core = project( "feather2-core" ).apply { kotlin().apply { implementation(runtime) implementation(grammar) testImplementation( javaexamples ) // For parsing feather scripts. implementation( "org.antlr:antlr4-runtime:$antlrVersion" ) // For generating java byte code. implementation( "org.ow2.asm:asm:$asmVersion" ) // For JarFileClassLoader implementation( "org.apache.xbean:xbean-classloader:$xbeanVersion" ) // Unit test framework testImplementation( "junit:junit:$junitVersion") // For debugging by comparing bytecode generated with Feather with that from compiled Java classes testImplementation( "org.ow2.asm:asm-util:$asmVersion") } publishing().apply { publishToGitLab( gitLabProjectID, tokenName ) } dokka() } // ==== foocad ==== (Only used for testing). val foocad = project( "feather2-foocad" ).apply { kotlin().apply { implementation( core ) implementation( runtime ) // Only used for testing. // I have a large collection of .foocad scripts (which are feather scripts) // So these can be used as backwards-compatible test-cases.L implementation( "uk.co.nickthecoder:foocad-core:$foocadVersion") implementation( "uk.co.nickthecoder:foocad-build:$foocadVersion") implementation( "uk.co.nickthecoder:foocad-extension:$foocadVersion" ) // Unit test framework testImplementation( "junit:junit:$junitVersion") // For debugging by comparing bytecode generated with Feather with that from compiled Java classes testImplementation( "org.ow2.asm:asm-util:$asmVersion" ) } } // ==== root ==== project().apply { defaultTasks( "installDist" ) kotlin().apply { implementation( core ) implementation( runtime ) implementation( "org.apache.xbean:xbean-classloader:$xbeanVersion" ) } application( "uk.co.nickthecoder.feather.Feather2" ) dokka().moduleName( "Feather2" ).version( version ) publishing().apply { publishToGitLab( gitLabProjectID, tokenName ) } exec( "ntc", "publishToNTC.feather", "--", version ).apply { dependsOn( "distZip", "dokkaHtml" ) } } buildGradleScripts() } func main(args: String...) { FeatherMetaBuild().build() } }