plugins { id 'idea' id 'java' id 'maven-publish' id 'dev.architectury.loom' id 'flywheel.java' id 'flywheel.package-infos' id 'flywheel.subproject' id 'flywheel.jar-sets' id 'flywheel.transitive-source-sets' } transitiveSourceSets { compileClasspath = sourceSets.main.compileClasspath create('api') { rootCompile() } create('lib') { rootCompile() compile sourceSets.api } create('backend') { rootCompile() compile sourceSets.api, sourceSets.lib } sourceSet(sourceSets.main) { compile sourceSets.api, sourceSets.lib, sourceSets.backend } sourceSet(sourceSets.test) { implementation sourceSets.api, sourceSets.lib, sourceSets.backend } } defaultPackageInfos { sources sourceSets.api, sourceSets.lib, sourceSets.backend, sourceSets.main } // For sharing with other subprojects. jarSets { createJars('apiOnly', sourceSets.api).createOutgoingConfiguration('common') createJars('lib').createOutgoingConfiguration('common') createJars('backend').createOutgoingConfiguration('common') createJars('impl', sourceSets.main).createOutgoingConfiguration('common') } // For publishing def apiLibJar = jarSets.createJars('api', sourceSets.api, sourceSets.lib) dependencies { modCompileOnly "net.fabricmc:fabric-loader:${fabric_loader_version}" testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' } test { useJUnitPlatform() } publishing { publications { register('mavenIntermediary', MavenPublication) { artifact apiLibJar.remapJar artifact apiLibJar.remapSources artifact apiLibJar.javadocJar artifactId = "flywheel-common-intermediary-api-${artifact_minecraft_version}" } register('mavenMojmap', MavenPublication) { artifact apiLibJar.jar artifact apiLibJar.sources artifact apiLibJar.javadocJar artifactId = "flywheel-common-mojmap-api-${artifact_minecraft_version}" } } }