Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create a distribution zip gradle task like the spring framework project #12507

Open
stepjacky opened this issue Jan 9, 2023 · 3 comments
Open
Labels
in: build An issue in the build type: enhancement A general enhancement

Comments

@stepjacky
Copy link

Expected Behavior

developers can build all of modules with its jar .source and api doc to a zip file

Current Behavior
none about it

Context

some developers doing development work at an offline environments without maven online package management. all of the modules need to be download from the internate . a distribution zip containing all modules file will make things convenient

@stepjacky stepjacky added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Jan 9, 2023
@stepjacky stepjacky changed the title create a distribution gradle task like the spring framework project create a distribution zip gradle task like the spring framework project Jan 9, 2023
@stepjacky
Copy link
Author

metioned above README build section,
Compile and test; build all JARs, distribution zips, and docs
but a clone the whole source from github and run fllowing build command
./gradlew build
after i can not find any distribution zips but a api doc .zip file

@sjohnr
Copy link
Member

sjohnr commented Jan 13, 2023

Thanks @stepjacky. Do you happen to know if there's a special plugin used by the Spring Framework team to produce such a zip file?

Edit:

In the meantime, you can also try ./gradlew publishAllPublicationsToLocalRepository. This will put everything in build/publications/repos, which should make it fairly easy to zip up.

@sjohnr sjohnr added in: build An issue in the build and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 13, 2023
@stepjacky
Copy link
Author

stepjacky commented Jan 14, 2023

i have read the spring frameworks build.gradle file
i found they release this zip from a custom task like this

/**

Create a distribution zip with everything:

docs, schemas, jars, source jars, javadoc jars
*/
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
group = "Distribution"
archiveBaseName.set("spring-framework")
archiveClassifier.set("dist")
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
"suitable for community download page."

ext.baseDir = "spring-framework-${project.version}";

from("src/docs/dist") {
include "readme.txt"
include "license.txt"
include "notice.txt"
into "${baseDir}"
expand(copyright: new Date().format("yyyy"), version: project.version)
}

from(zipTree(docsZip.archiveFile)) {
into "${baseDir}/docs"
}

from(zipTree(schemaZip.archiveFile)) {
into "${baseDir}/schema"
}

moduleProjects.each { module ->
into ("${baseDir}/libs") {
from module.jar
if (module.tasks.findByPath("sourcesJar")) {
from module.sourcesJar
}
if (module.tasks.findByPath("javadocJar")) {
from module.javadocJar
}
}
}
}

distZip.mustRunAfter moduleProjects.check

the file path is spring-framework\framework-docs\framework-docs.gradle
line 212 ,hope to help !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: build An issue in the build type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants