Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  SOLR-14237: Fix HDFS nightly test failure
  LUCENE-9278: concatenate paths for sourcepath using path separator rather than whitespace (which causes invalid option to be passed to javadoc).
  LUCENE-9333: Add gradle task to compile changes.txt to a html (apache#1468)
  update CHANGES for apache#807
  Fix tests to survive nightly runs with many documents
  SOLR-14173: Don't use JQuery-Slim as it breaks the sidebar sub-menu system.
  SOLR-14237: A new panel with security info in admin UI's dashboard
  SOLR-14237: A new panel with security info in admin UI's dashboard
  LUCENE-7788: fail precommit on unparameterised log messages and examine for wasted work/objects
  SOLR-14173: Change left nav item highlighting to fix menu jumpiness when hovering/selecting
  LUCENE-9349: TermInSetQuery should use consumeMatchingTerms in visit() (apache#1465)
  LUCENE-9089: update FST usage example
  • Loading branch information
MarcusSorealheis committed Apr 30, 2020
2 parents 9dd4a84 + 9ed5b6a commit 4fbeb9d
Show file tree
Hide file tree
Showing 85 changed files with 1,016 additions and 459 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@ apply from: file('gradle/ant-compat/test-classes-cross-deps.gradle')
apply from: file('gradle/ant-compat/artifact-naming.gradle')
apply from: file('gradle/ant-compat/solr-forbidden-apis.gradle')
apply from: file('gradle/ant-compat/forbidden-api-rules-in-sync.gradle')

apply from: file('gradle/documentation/documentation.gradle')
apply from: file('gradle/documentation/changes-to-html.gradle')
89 changes: 89 additions & 0 deletions gradle/documentation/changes-to-html.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

configure(subprojects.findAll { it.path == ':lucene' || it.path == ':solr' }) {
task changesToHtml(type: ChangesToHtmlTask)
}

// compile changes.txt into an html file
class ChangesToHtmlTask extends DefaultTask {

@Input
File changesFile = project.file("CHANGES.txt")

@Input
File changesDoapFile = project.rootProject.file("dev-tools/doap/${project.name}.rdf")

@InputDirectory
File siteDir = project.rootProject.file("lucene/site/changes")

@OutputDirectory
File targetDir = project.file("${project.docroot}/changes")

def luceneDocUrl = "https://lucene.apache.org/core/${project.version.replace(".", "_")}/".toString()

def loadVersions(File outfile) {
// load version properties from DOAP RDF
def prefix = "doap.${project.name}".toString()
ant.xmlproperty(keeproot: false, file: changesDoapFile, collapseAttributes: false, prefix: "${prefix}")
outfile.withWriter("UTF-8") { writer ->
writer.println(ant.properties["${prefix}.Project.release.Version.revision"])
writer.println(ant.properties["${prefix}.Project.release.Version.created"])
}
}

def toHtml(File versionsFile) {
def output = new ByteArrayOutputStream()
def result = project.exec {
executable "perl"
standardInput changesFile.newInputStream()
standardOutput project.file("${targetDir}/Changes.html").newOutputStream()
errorOutput = output
ignoreExitValue = true

args += [
"-CSD",
project.rootProject.file("${siteDir}/changes2html.pl").toString(),
"${project.name}",
versionsFile.toString(),
luceneDocUrl
]
}

if (result.getExitValue() != 0) {
throw new GradleException("Changes generation failed:\n${output}")
}
}

@TaskAction
def convert() {
project.mkdir targetDir
if (changesFile.exists() && changesDoapFile.exists()) {
File versionsFile = project.file("${project.buildDir}/doap.${project.name}.changes.version.dates.csv")
loadVersions(versionsFile)
toHtml(versionsFile)
project.copy {
from siteDir
into targetDir
include "*.css"
}
versionsFile.delete()
} else {
throw new GradleException("Changes file ${changesFile} or Doap file ${changesDoapFile} not found.")
}
}
}
37 changes: 37 additions & 0 deletions gradle/documentation/documentation.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

configure(rootProject) {
task documentation() {
group = 'documentation'
description = 'Generate all documentation'

dependsOn allprojects.collect { prj ->
prj.tasks.matching { task -> task.name in [
"changesToHtml"
// TODO: "markdownToHtml"
// TODO: "gatherJavadocs"
]}
}
}
}

configure(subprojects.findAll { it.path == ':lucene' || it.path == ':solr' }) {
ext {
docroot = "${project.buildDir}/documentation"
}
}
2 changes: 1 addition & 1 deletion gradle/render-javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ allprojects {

def opts = []
opts += [ "-overview ${file("src/java/overview.html").toString()}" ]
opts += [ "-sourcepath ${srcDirs.join(' ')}" ]
opts += [ "-sourcepath ${srcDirs.join(File.pathSeparator)}" ]
opts += [ "-subpackages ${project.path.startsWith(':lucene') ? 'org.apache.lucene' : 'org.apache.solr'}"]
opts += [ "-d ${project.javadoc.destinationDir.toString()}" ]
opts += [ "-protected" ]
Expand Down
Loading

0 comments on commit 4fbeb9d

Please sign in to comment.