Skip to content

Commit

Permalink
SOLR-16299: Remove symlinks for ref-guide examples (#946)
Browse files Browse the repository at this point in the history
The example classes now live in the ref-guide module
  • Loading branch information
HoustonPutman authored Jul 19, 2022
1 parent 6e61811 commit 0a6960f
Show file tree
Hide file tree
Showing 13 changed files with 1,652 additions and 1,611 deletions.
4 changes: 4 additions & 0 deletions gradle/validation/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ configure(project(":solr").subprojects) { prj ->
// Exclude Hadoop copied files to make upgrades easier
targetExclude "src/**/org/apache/hadoop/**"
break
case ":solr:solr-ref-guide":
// Apply to all example Java sources in the ref-guide
target "modules/**/examples/*.java"
break
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ Build

* SOLR-16264: Set versions for all Antora build tools (Houston Putman)

* SOLR-16299: Ref-guide examples are no longer symlinked from SolrJ, they live in the ref-guide module (Houston Putman)

================== 9.0.0 ==================

New Features
Expand Down
40 changes: 40 additions & 0 deletions solr/solr-ref-guide/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@

import org.apache.tools.ant.util.TeeOutputStream

apply plugin: 'java'

description = 'Solr Reference Guide'

/*
Antora Logic - Building the ref-guide
*/

def officialSiteIncludePrerelease = propertyOrEnvOrDefault("refguide.official.includePrereleaseVersions", "SOLR_REF_GUIDE_OFFICIAL_INCLUDE_PRERELEASE", "false").toBoolean()

def buildLocalUI = propertyOrEnvOrDefault("refguide.buildLocalUI", "SOLR_REF_GUIDE_BUILD_LOCAL_UI", "false").toBoolean()
Expand Down Expand Up @@ -503,3 +509,37 @@ task buildOfficialSite(type: NpxTask) {
project.logger.lifecycle("\t${project.ext.siteDir}")
}
}

/*
Compiling, Testing and Validation for the java examples in the Solr Ref Guide
*/

sourceSets {
test {
java {
srcDirs = ['modules/configuration-guide/examples', 'modules/deployment-guide/examples', 'modules/getting-started/examples', 'modules/indexing-guide/examples', 'modules/query-guide/examples']
}
}
}

dependencies {
// For the SolrJ examples
testImplementation project(":solr:core")
testImplementation project(":solr:solrj")
testImplementation project(":solr:test-framework")
testImplementation 'junit:junit'
}

// Copy all the test resource files from SolrJ to the build/resources/test directory
// of the examples so we can avoid duplication of the test resource files like
// schemas and SolrConfigs.
task copySolrjTestResources(type: Copy) {
from(project(':solr:solrj').sourceSets.test.resources.srcDirs) {
exclude '**/*.java'
}
into sourceSets.test.output.resourcesDir
}

tasks.processTestResources.configure {
dependsOn copySolrjTestResources
}

This file was deleted.

Loading

0 comments on commit 0a6960f

Please sign in to comment.