aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao/build.gradle
blob: d777d3c04e3a37e7a37540238604e6bb32cc9fb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
sonar {
  properties {
    property 'sonar.projectName', "${projectTitle} :: DAO"
  }
}

dependencies {
  // please keep the list grouped by configuration and ordered by name

  api 'com.google.guava:guava'
  api 'com.google.protobuf:protobuf-java'
  api 'commons-io:commons-io'
  api 'commons-lang:commons-lang'
  api 'net.jpountz.lz4:lz4'
  api 'org.mybatis:mybatis'
  api 'org.sonarsource.api.plugin:sonar-plugin-api'

  api project(':server:sonar-db-core')
  api project(':server:sonar-db-migration')
  api project(':sonar-core')

  compileOnlyApi 'com.google.code.findbugs:jsr305'

  testImplementation 'com.tngtech.java:junit-dataprovider'
  testImplementation 'commons-dbutils:commons-dbutils'
  testImplementation 'junit:junit'
  testImplementation 'org.assertj:assertj-core'
  testImplementation 'org.assertj:assertj-guava'
  testImplementation 'org.mockito:mockito-core'
  testImplementation 'org.sonarsource.orchestrator:sonar-orchestrator-junit4'
  testImplementation project(':sonar-testing-harness')
  testImplementation project(':sonar-plugin-api-impl')

  testCompileOnly 'com.google.code.findbugs:jsr305'

  testRuntimeOnly 'com.h2database:h2'
  testRuntimeOnly 'com.microsoft.sqlserver:mssql-jdbc'
  testRuntimeOnly 'com.oracle.database.jdbc:ojdbc11'
  testRuntimeOnly 'org.postgresql:postgresql'

  testFixturesApi testFixtures(project(':server:sonar-db-core'))

  testFixturesImplementation 'com.h2database:h2'

  testFixturesCompileOnly 'com.google.code.findbugs:jsr305'
}

test {
  systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
}

task dumpSchema(type:JavaExec) {
    mainClass = 'org.sonar.db.dump.DumpSQSchema'
    classpath = sourceSets.test.runtimeClasspath
}
tasks.check.dependsOn dumpSchema

task createDB(type:JavaExec) {
    mainClass = 'org.sonar.db.createdb.CreateDb'
    classpath = sourceSets.test.runtimeClasspath
    systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
    if (!project.version.endsWith("-SNAPSHOT")) {
        systemProperty 'sonar.runtimeVersion', project.version
    }
}

task testJar(type: Jar) {
  archiveClassifier = 'tests'
  from sourceSets.test.output
}

configurations {
  tests
}

artifacts {
   tests testJar
}

jar {
    // remove exclusion on proto files so that they can be included by other modules
    setExcludes([])
}