diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2018-03-18 22:13:43 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-03-22 12:37:47 +0100 |
commit | 0a9d9db7f85e7d45b4ffa319d262231f311641f9 (patch) | |
tree | adb10e40de4c3ae338ee2c29f10c9caf8cb821c9 /server | |
parent | 73e39a73e70b97ab0043cf5abc4eddcf68f2ce00 (diff) | |
download | sonarqube-0a9d9db7f85e7d45b4ffa319d262231f311641f9.tar.gz sonarqube-0a9d9db7f85e7d45b4ffa319d262231f311641f9.zip |
Single Gradle build for SQ and core plugins
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-db-core/build.gradle | 17 | ||||
-rw-r--r-- | server/sonar-db-core/src/test/java/org/sonar/db/CoreTestDb.java | 5 | ||||
-rw-r--r-- | server/sonar-db-dao/build.gradle | 18 | ||||
-rw-r--r-- | server/sonar-db-migration/build.gradle | 8 | ||||
-rw-r--r-- | server/sonar-server/build.gradle | 8 |
5 files changed, 47 insertions, 9 deletions
diff --git a/server/sonar-db-core/build.gradle b/server/sonar-db-core/build.gradle index bfb6921b78b..8a4ee3042d6 100644 --- a/server/sonar-db-core/build.gradle +++ b/server/sonar-db-core/build.gradle @@ -24,7 +24,6 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305' testCompile 'com.google.code.findbugs:jsr305' - testCompile 'com.h2database:h2' testCompile 'com.microsoft.sqlserver:mssql-jdbc' testCompile 'com.oracle.jdbc:ojdbc8' testCompile 'junit:junit' @@ -35,13 +34,19 @@ dependencies { testCompile 'org.postgresql:postgresql' testCompile 'org.sonarsource.orchestrator:sonar-orchestrator' testCompile project(':sonar-testing-harness') + + testRuntime 'com.h2database:h2' + testRuntime 'com.microsoft.sqlserver:mssql-jdbc' + testRuntime 'com.oracle.jdbc:ojdbc8' + testRuntime 'mysql:mysql-connector-java' + testRuntime 'org.postgresql:postgresql' } task createDB(type:JavaExec) { main = 'org.sonar.db.CreateDb' classpath = sourceSets.test.runtimeClasspath systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl') - systemProperty 'sonar.runtimeVersion', version + systemProperty 'sonar.runtimeVersion', System.getProperty('sonar.runtimeVersion') systemProperty 'orchestrator.artifactory.apiKey', System.getProperty('orchestrator.artifactory.apiKey') systemProperty 'orchestrator.artifactory.repositories', System.getProperty('orchestrator.artifactory.repositories') } @@ -56,6 +61,14 @@ task testJar(type: Jar) { from sourceSets.test.output } +configurations { + tests +} + +artifacts { + tests testJar +} + artifactoryPublish.skip = false // Used by core plugins diff --git a/server/sonar-db-core/src/test/java/org/sonar/db/CoreTestDb.java b/server/sonar-db-core/src/test/java/org/sonar/db/CoreTestDb.java index bcbd1b42e03..6b963d27e31 100644 --- a/server/sonar-db-core/src/test/java/org/sonar/db/CoreTestDb.java +++ b/server/sonar-db-core/src/test/java/org/sonar/db/CoreTestDb.java @@ -43,6 +43,7 @@ import org.sonar.api.utils.log.Loggers; import org.sonar.db.dialect.H2; import org.sonar.process.logging.LogbackHelper; +import static org.apache.commons.lang.StringUtils.isNotEmpty; import static org.sonar.process.ProcessProperties.Property.JDBC_USERNAME; /** @@ -73,7 +74,7 @@ class CoreTestDb { CoreTestDb(@Nullable String schemaPath) { if (db == null) { Settings settings = new MapSettings().addProperties(System.getProperties()); - if (settings.hasKey("orchestrator.configUrl")) { + if (isNotEmpty(settings.getString("orchestrator.configUrl"))) { loadOrchestratorSettings(settings); } String login = settings.getString(JDBC_USERNAME.getKey()); @@ -176,7 +177,7 @@ class CoreTestDb { settings.setProperty(entry.getKey(), interpolatedValue); } } catch (Exception e) { - throw new IllegalStateException(e); + throw new IllegalStateException("Cannot load Orchestrator properties from:" + url, e); } finally { IOUtils.closeQuietly(input); } diff --git a/server/sonar-db-dao/build.gradle b/server/sonar-db-dao/build.gradle index 24a45f382e1..98149ad92e5 100644 --- a/server/sonar-db-dao/build.gradle +++ b/server/sonar-db-dao/build.gradle @@ -13,7 +13,6 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305' - testCompile 'com.h2database:h2' testCompile 'com.tngtech.java:junit-dataprovider' testCompile 'junit:junit' testCompile 'org.assertj:assertj-core' @@ -24,11 +23,16 @@ dependencies { testCompile project(':server:sonar-db-core').sourceSets.test.output testCompileOnly 'com.google.code.findbugs:jsr305' + + testRuntime 'com.h2database:h2' + testRuntime 'com.microsoft.sqlserver:mssql-jdbc' + testRuntime 'com.oracle.jdbc:ojdbc8' + testRuntime 'mysql:mysql-connector-java' + testRuntime 'org.postgresql:postgresql' } test { - if (System.hasProperty('orchestrator.configUrl')) - systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl') + systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl') } task testJar(type: Jar) { @@ -36,6 +40,14 @@ task testJar(type: Jar) { from sourceSets.test.output } +configurations { + tests +} + +artifacts { + tests testJar +} + artifactoryPublish.skip = false // Used by core plugins diff --git a/server/sonar-db-migration/build.gradle b/server/sonar-db-migration/build.gradle index 2198734c3a1..f26ceaf8255 100644 --- a/server/sonar-db-migration/build.gradle +++ b/server/sonar-db-migration/build.gradle @@ -13,7 +13,6 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305' testCompile 'com.google.code.findbugs:jsr305' - testCompile 'com.h2database:h2' testCompile 'com.tngtech.java:junit-dataprovider' testCompile 'junit:junit' testCompile 'org.assertj:assertj-core' @@ -21,10 +20,15 @@ dependencies { testCompile 'org.mockito:mockito-core' testCompile project(':sonar-testing-harness') testCompile project(':server:sonar-db-core').sourceSets.test.output + + testRuntime 'com.h2database:h2' + testRuntime 'com.microsoft.sqlserver:mssql-jdbc' + testRuntime 'com.oracle.jdbc:ojdbc8' + testRuntime 'mysql:mysql-connector-java' + testRuntime 'org.postgresql:postgresql' } test { - if (System.hasProperty('orchestrator.configUrl')) systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl') } diff --git a/server/sonar-server/build.gradle b/server/sonar-server/build.gradle index 34995b84bf8..251f852de2b 100644 --- a/server/sonar-server/build.gradle +++ b/server/sonar-server/build.gradle @@ -82,6 +82,14 @@ task testJar(type: Jar) { from sourceSets.test.output } +configurations { + tests +} + +artifacts { + tests testJar +} + artifactoryPublish.skip = false // Used by core plugins |