Skip to content

Commit

Permalink
Merge pull request #98 from battlecode/jerrym-sources
Browse files Browse the repository at this point in the history
Ensure source code is released by buildsystem
  • Loading branch information
j-mao authored Jan 9, 2023
2 parents 9ccea88 + a16f4d2 commit 57b8784
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 16 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ task runClient {
}
}

task release(dependsOn: ['release_main', 'release_docs'])
task release(dependsOn: ['release_main', 'release_docs', 'release_sources'])

task release_main(type: Jar, dependsOn: [':engine:build']) {
File f_version = new File(project.projectDir, "battlecode_version");
Expand All @@ -105,7 +105,7 @@ task release_main(type: Jar, dependsOn: [':engine:build']) {

archiveBaseName = "battlecode";
if (project.hasProperty("release_version"))
version = project.property("release_version");
archiveVersion = project.property("release_version");
destinationDirectory = project.projectDir;

FileCollection src = files(f_version);
Expand All @@ -126,12 +126,21 @@ task release_docs(type: Jar, dependsOn: [':engine:javadoc']) {

archiveBaseName = "battlecode-javadoc"
if (project.hasProperty("release_version"))
version = project.property("release_version");
archiveVersion = project.property("release_version");
destinationDirectory = project.projectDir;

from new File(project(":engine").docsDir, "javadoc")
}

task release_sources(type: Jar, dependsOn: classes) {
archiveBaseName = "battlecode-source"
if (project.hasProperty("release_version"))
archiveVersion = project.property("release_version");
destinationDirectory = project.projectDir;

from project(":engine").sourceSets.main.allSource
}

task prodClient {
doLast {
exec {
Expand Down Expand Up @@ -178,6 +187,10 @@ publishing {
artifact release_docs {
classifier 'javadoc'
}

artifact release_sources {
classifier 'sources'
}
}

clientWin(MavenPublication) {
Expand Down
4 changes: 4 additions & 0 deletions engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ sourceCompatibility = 1.8
sourceSets {
main {
java.srcDirs = ["src/main"]
java.includes = ["**/*.java"]
resources.srcDirs = ["src/main"]
resources.excludes = ["**/*.java"]

java.destinationDirectory.set(file("$buildDir/classes"))
output.resourcesDir = "$buildDir/classes"
}
test {
java.srcDirs = ["src/test"]
java.includes = ["**/*.java"]
resources.srcDirs = ["src/test"]
resources.excludes = ["**/*.java"]

java.destinationDirectory.set(file("$buildDir/tests"))
output.resourcesDir = "$buildDir/tests"
Expand Down

0 comments on commit 57b8784

Please sign in to comment.