Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions dev-docs/gradle-help/workflow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ Put together a local Solr binary "distribution" folder:
gradlew -p solr/packaging assemble
ls solr/packaging/build/solr-* # expanded directory

For quick local development
gradlew -p solr/packaging dev
ls solr/packaging/build/dev # expanded directory
Build & run Solr directly from Gradle, skipping "bin/solr", retaining data between runs:
gradlew -p solr/packaging runDev

Build & run Solr, retaining data between runs:
gradlew -p solr/packaging devSlim
(cd solr/packaging/build/dev-slim && bin/solr start -f)

Generate the release tar archive (see publishing.txt for details)
gradlew -p solr/distribution assembleRelease
ls solr/distribution/build/release # release archives

Build a docker image from the local repository (see docker/gradle-help.txt for more)
Build & run a docker image from the local repository (see docker/gradle-help.txt for more)
gradlew dockerBuild dockerTag
docker run --rm -p 8983:8983 apache/solr:9.0.0-SNAPSHOT

Expand Down
2 changes: 1 addition & 1 deletion gradle/help.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ configure(rootProject) {
doLast {
println ""
println "This is the Solr gradle build. See some guidelines, "
println "ant-equivalent commands, etc. under help/*; or type:"
println "ant-equivalent commands, etc. under dev-docs/gradle-help/*; or type:"
println ""
helpFiles.each { section, path, sectionInfo ->
println String.format(Locale.ROOT,
Expand Down
33 changes: 33 additions & 0 deletions solr/packaging/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,39 @@ artifacts {
solrSlimTgz(slimDistTar)
}

tasks.register('runDev', JavaExec) {
group = 'application'
description = 'Starts Solr for local experimentation. Does NOT use the bin/solr script.'
dependsOn 'devSlim'

workingDir = file("$slimDevDir/server")

// Intentionally not synchronizing the logic here with bin/solr; don't want the burden

doFirst {
println "To attach a debugger, at the CLI pass: --debug-jvm"
println "To pass JVM args, at the CLI pass: -PjvmArgs='--add-modules jdk.incubator.vector'"
println "To pass system properties, at the CLI pass: -Dsolr.port.listen=8983"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

}

maxHeapSize = project.findProperty('maxHeapSize') ?: '1G'

jvmArgs = [] // don't use defaults from our build that assume this is a typical build task
jvmArgs((project.findProperty('jvmArgs') ?: '').split())

systemProperty 'solr.port.listen', '8983'
systemProperty 'solr.install.dir', file("$workingDir/..")
systemProperty 'solr.logs.dir', file("$workingDir/logs")
systemProperty 'solr.zookeeper.server.enabled', 'true' // SolrCloud; embedded ZK

// Propagate CLI system properties (override defaults above)
systemProperties += gradle.startParameter.systemPropertiesArgs

classpath = files("$workingDir/start.jar")

args((project.findProperty('args') ?: '--module=http').split())
}

task downloadBats(type: NpmTask) {
group = 'Build Dependency Download'
args = ["install", "https://github.com/bats-core/bats-core#v${libs.versions.bats.core.get()}",
Expand Down
Loading