Skip to content

Commit

Permalink
fixed building api jar
Browse files Browse the repository at this point in the history
  • Loading branch information
cech12 committed Jan 2, 2024
1 parent 18c51ef commit 41b3be7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/).

## [1.20.2-3.0.0.1] - 2024-01-02
### Changed
- fixed building api jar

## [1.20.2-3.0.0.0] - 2023-12-31
### Changed
- Move to Multiloader mod template to support Forge and Neoforge
Expand Down
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ subprojects {
from(rootProject.file("LICENSE"))
}

tasks.register('apiJar', Jar) {
archiveClassifier.set('api')
include project.group.replace('.', '/') + '/api/**/*'
from sourceSets.main.allSource
}

repositories {
mavenCentral()
maven {
Expand Down
7 changes: 7 additions & 0 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ tasks.withType(Javadoc).configureEach {
tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}
tasks.named("apiJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}

processResources {
from project(":common").sourceSets.main.resources
}

artifacts {
archives apiJar
}

jar.finalizedBy('reobfJar')

publishing {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Every field you add must be added to the root build.gradle expandProps map.

# Project
version=3.0.0.0
version=3.0.0.1
group=de.cech12.bucketlib
mod_id=bucketlib
mod_name=BucketLib
Expand Down
8 changes: 8 additions & 0 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}

tasks.named("apiJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}

tasks.withType(ProcessResources).matching(notNeoTask).configureEach {
from project(":common").sourceSets.main.resources
}

artifacts {
archives apiJar
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down

0 comments on commit 41b3be7

Please sign in to comment.