lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject [lucene-solr] branch jira/SOLR-13452_gradle_5 updated: SOLR-13452: Clean up and fix some build test issues on osx and around buildSrc. More to come.
Date Mon, 26 Aug 2019 20:09:16 GMT
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch jira/SOLR-13452_gradle_5
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/jira/SOLR-13452_gradle_5 by this push:
     new 5435ae6  SOLR-13452: Clean up and fix some build test issues on osx and around buildSrc.
More to come.
5435ae6 is described below

commit 5435ae62150a9b977feb730816219629496e31dc
Author: markrmiller <millerman@apple.com>
AuthorDate: Mon Aug 26 15:09:03 2019 -0500

    SOLR-13452: Clean up and fix some build test issues on osx and around buildSrc. More to
come.
---
 build.gradle                                         | 20 +++++++++++++++-----
 buildSrc/build-wdocker-test/Dockerfile               |  7 ++++---
 buildSrc/build-wdocker-test/start.sh                 |  2 +-
 buildSrc/build-wdocker-test/test-build.sh            | 19 +++++++++++--------
 buildSrc/build.gradle                                | 14 +++++++++++++-
 buildSrc/ide/eclipse.gradle                          |  2 +-
 .../apache/lucene/gradle/checks/RatSources.groovy    |  2 +-
 7 files changed, 46 insertions(+), 20 deletions(-)

diff --git a/build.gradle b/build.gradle
index dfad4a9..78d6b36 100644
--- a/build.gradle
+++ b/build.gradle
@@ -62,10 +62,17 @@ apply from: mfile(rootProjectDir, 'buildSrc/common/build-help.gradle')
 
 // *** lucene-solr all module config - configure all lucene-solr projects, including root
project
 configure(luceneSolrProjects) {
-  buildDir = file("build")
-  
-  // setup repositories
-  apply from: mfile(rootProjectDir, 'buildSrc/common/configure-repositories.gradle')
+    buildDir = file("build")
+    
+    // setup repositories
+    apply from: mfile(rootProjectDir, 'buildSrc/common/configure-repositories.gradle')
+    
+    println 'apply forbidden to ' + project.name
+    project.plugins.apply(ForbiddenApisPluginWrapper)
+}
+
+configure(luceneSolrProjects) {
+  project.evaluationDependsOn(':buildSrc')
   
   task ratSources(type: RatSources) {
       group = 'Verification'
@@ -78,6 +85,7 @@ configure(luceneSolrProjects) {
       if (project.hasProperty('check')) {
         check.dependsOn ratSources
       }
+      dependsOn rootProject.project(':buildSrc').tasks.setupRatPath
   }
 }
 
@@ -118,7 +126,7 @@ configure(luceneSolrSubProjects) {
       check.dependsOn checkSourcePatterns
     }
       
-    project.plugins.apply(ForbiddenApisPluginWrapper)
+
     
     sourceCompatibility = "11"
     targetCompatibility = "11"
@@ -244,6 +252,8 @@ configure(allprojects) {
       
       exclude group: 'org.apache.yetus', module: 'audience-annotations' // annotations jar
brought in by zk
       exclude group: 'org.slf4j', module: 'slf4j-log4j12' // zk and perhaps others can bring
in log4j12 binding
+      
+      exclude group: 'xml-apis', module: 'xml-apis:xml-apis' // this is brought in depending
on env - ensure it's not
     }
     
     modules {
diff --git a/buildSrc/build-wdocker-test/Dockerfile b/buildSrc/build-wdocker-test/Dockerfile
index 22b5ce6..8622c4d 100644
--- a/buildSrc/build-wdocker-test/Dockerfile
+++ b/buildSrc/build-wdocker-test/Dockerfile
@@ -34,12 +34,13 @@ RUN export JAVA_HOME
 
 RUN useradd -ms /bin/bash lucene
 
+RUN mkdir -p /home/lucene/.gradle
+RUN mkdir -p /home/lucene/project
+
 # Define working directory.
 WORKDIR /home/lucene/project
 
-RUN mkdir -p /home/lucene/project
-
-RUN chown -R lucene:lucene /home/lucene
+#RUN chown -R lucene:lucene /home/lucene
 
 USER lucene
 
diff --git a/buildSrc/build-wdocker-test/start.sh b/buildSrc/build-wdocker-test/start.sh
index bc5c6a5..3edf411 100644
--- a/buildSrc/build-wdocker-test/start.sh
+++ b/buildSrc/build-wdocker-test/start.sh
@@ -69,7 +69,7 @@ exec() {
   echo "done"
 }
 
-cmd="cp -r /home/lucene/gradle /home/lucene/.gradle"
+cmd="cp -r /home/lucene/gradle/. /home/lucene/.gradle/"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 
diff --git a/buildSrc/build-wdocker-test/test-build.sh b/buildSrc/build-wdocker-test/test-build.sh
index 8242d8a..b629c5c 100644
--- a/buildSrc/build-wdocker-test/test-build.sh
+++ b/buildSrc/build-wdocker-test/test-build.sh
@@ -51,35 +51,38 @@ gradle_args="--console=plain -x verifyLocks"
 # NOTE: we don't clean right now, as it would wipe out buildSrc/build on us for the host,
but buildTest dependsOn clean
 
 # build without unit tests
-cmd="cd /home/lucene/project;./gradlew ${gradle_args} build -x test"
+cmd="./gradlew ${gradle_args} build -x test"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 # test regenerate task
-cmd="cd /home/lucene/project;./gradlew ${gradle_args} regenerate"
+cmd="./gradlew ${gradle_args} regenerate"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 # test forbiddenApis task
-cmd="cd /home/lucene/project;./gradlew ${gradle_args} forbiddenApis"
+cmd="./gradlew ${gradle_args} forbiddenApis"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 # test eclipse tasks
-cmd="cd /home/lucene/project;./gradlew ${gradle_args} cleanEclipse eclipse"
+cmd="./gradlew ${gradle_args} cleanEclipse"
+exec "${cmd}" "${exec_args}" || { exit 1; }
+
+cmd="./gradlew ${gradle_args} eclipse"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 # test unusedDependencies task
-cmd="cd /home/lucene/project;./gradlew ${gradle_args} solr:solr-core:unusedDependencies"
+cmd="./gradlew ${gradle_args} solr:solr-core:unusedDependencies"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 # try deeper structure
-cmd="cd /home/lucene/project;./gradlew ${gradle_args} solr:contrib:solr-contrib-clustering:unusedDependencies"
+cmd="./gradlew ${gradle_args} solr:contrib:solr-contrib-clustering:unusedDependencies"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 # test missingDependencies task
-cmd="cd /home/lucene/project;./gradlew ${gradle_args} solr:solr-core:missingDependencies"
+cmd="./gradlew ${gradle_args} solr:solr-core:missingDependencies"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 # we should still be able to build now
-cmd="cd /home/lucene/project;./gradlew ${gradle_args} build -x test -x verifyLocks"
+cmd="./gradlew ${gradle_args} build -x test -x verifyLocks"
 exec "${cmd}" "${exec_args}" || { exit 1; }
 
 
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index 3e7fbc8..97e86b6 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -78,7 +78,11 @@ sourceSets {
   }
 }
 
-project.rootProject.ext.ratPath = { configurations.rat.asPath }
+task setupRatPath {
+  doFirst {
+    project.rootProject.ext.ratPath = configurations.rat.asPath
+  }
+}
 
 configurations {
   buildTestImplementation.extendsFrom testImplementation
@@ -106,3 +110,11 @@ clean.doLast {
   // hack for eclipse issue
   file("$buildDir/pluginUnderTestMetadata").mkdirs()
 }
+
+println 'root project is ' + project.rootProject.name
+if (project.rootProject != project) {
+  forbiddenApis {
+    println 'sigs '  + signatures
+    signatures -= ['java.io.File']
+  }
+}
diff --git a/buildSrc/ide/eclipse.gradle b/buildSrc/ide/eclipse.gradle
index 82545ea..c9335b5 100644
--- a/buildSrc/ide/eclipse.gradle
+++ b/buildSrc/ide/eclipse.gradle
@@ -88,7 +88,7 @@ eclipse {
       }
       
       // Jetty mod files make eclipse sad
-      new File('.settings').mkdirs()
+      file('.settings').mkdirs()
       file('.settings/org.eclipse.wst.validation.prefs').text = """
 eclipse.preferences.version=1
 override=true
diff --git a/buildSrc/src/main/groovy/org/apache/lucene/gradle/checks/RatSources.groovy b/buildSrc/src/main/groovy/org/apache/lucene/gradle/checks/RatSources.groovy
index c8231b9..ea9e818 100644
--- a/buildSrc/src/main/groovy/org/apache/lucene/gradle/checks/RatSources.groovy
+++ b/buildSrc/src/main/groovy/org/apache/lucene/gradle/checks/RatSources.groovy
@@ -58,7 +58,7 @@ class RatSources extends DefaultTask {
       excludeString += it
     }
 
-    ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml', classpath: project.rootProject.ext.ratPath())
+    ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml', classpath: project.rootProject.ext.ratPath)
 
     ant.report(reportFile: logFile.getAbsolutePath(), addDefaultLicenseMatchers: 'true')
{
       ant.fileset(dir: project.projectDir.getAbsolutePath(), includes: "*.xml", excludes:
excludeString)


Mime
View raw message