Project

General

Profile

Services » History » Version 3

Alexey Demakov, 01/21/2016 01:51 PM

1 1 Alexey Demakov
h1. Services
2
3
* "Jenkins Continuous Integration Server":http://forge.ispras.ru:8080 - internal access only
4 2 Alexey Demakov
5
6 1 Alexey Demakov
* "Sonarube quality management platform, dedicated to continuously analyzing and measuring the technical quality of source code":http://forge.ispras.ru:9000 - internal access only
7 2 Alexey Demakov
8
*build.gradle:*
9
<pre>
10
plugins {
11
  id ''org.sonarqube'' version ''1.0''
12
}
13
14
sonarqube {
15
     properties {
16
        property ''sonar.host.url'', ''http://forge.ispras.ru:9000''
17
        property ''sonar.jdbc.url'', ''jdbc:mysql://localhost:3306/sonar''
18
        property ''sonar.jdbc.driverClassName'', ''com.mysql.jdbc.Driver''
19
        property ''sonar.jdbc.username'', ''sonar''
20
        property ''sonar.jdbc.password'', ''sonar''
21
    }
22
}
23
</pre>
24
25 1 Alexey Demakov
* "Nexus Repository manager":http://forge.ispras.ru:8082/nexus/ - internal access only
26 2 Alexey Demakov
27
*build.gradle:*
28
<pre>
29
plugins {
30
  id ''net.saliman.properties'' version ''1.4.4''
31
  id ''net.researchgate.release'' version ''2.3.5''
32
}
33
34
apply plugin: ''maven-publish''
35
36 3 Alexey Demakov
repositories {
37
  maven {
38
    url ''http://forge.ispras.ru:8082/nexus/content/repositories/snapshots''
39
  }
40
  maven {
41
    url ''http://forge.ispras.ru:8082/nexus/content/repositories/releases''
42
  }
43
  jcenter()
44
}
45
46 2 Alexey Demakov
project.group = projectGroup
47
48
release {
49
  failOnCommitNeeded = false
50
51
  versionPatterns = [
52
    // Increments build number: "0.2.5-alpha-150428" => "0.2.6-alpha-150428"
53
    /(^\d+\.\d+\.)(\d+)(-[^-]*)(-[^-]*$)/: 
54
    { Matcher m, Project p -> m.replaceAll("${ m[0][1] }${ (m[0][2] as int) + 1 }${ m[0][3] }" ) }
55
  ]
56
}
57
58
String getCurrentDateString()  {
59
  new SimpleDateFormat( ''yyMMdd'' ).format( new Date() )
60
}
61
62
task unSnapshotVersion.doLast {
63
  def version = project.version.toString()
64
  version += ''-'' + getCurrentDateString()
65
   project.plugins.getPlugin( net.researchgate.release.ReleasePlugin.class )
66
  .updateVersionProperty( version )
67
}
68
69
publishing {
70
  publications {
71
    maven(MavenPublication) {
72
      groupId projectGroup
73
      artifactId projectName
74
      version project.version
75
76
      from components.java
77
    }
78
  }
79
  repositories {
80
    maven {
81
      if(project.version.endsWith(''-SNAPSHOT'')) {
82
        url ''http://forge.ispras.ru:8082/nexus/content/repositories/snapshots''
83
      } else {
84
        url ''http://forge.ispras.ru:8082/nexus/content/repositories/releases''
85
      }
86
      credentials {
87
        username hasProperty(''repoUser'') ? repoUser : ''''
88
        password hasProperty(''repoPassword'') ? repoPassword : ''''
89
      }
90
      authentication {
91
        basic(BasicAuthentication)
92
      }
93
    }
94
  }
95
}
96
97
afterReleaseBuild.dependsOn publish
98
</pre>
99
100
*gradle.properties:*
101
<pre>
102
projectGroup=...
103
projectName=..
104
# gradle-release-plugin restriction: use only ''='' as separator
105
version=...
106
</pre>
107
108
*gradle-local.properties:*
109
<pre>repoUser=...
110
repoPassword=...
111
</pre>
112
113
*.gitignore:*
114
<pre>
115
gradle-local.properties
116
</pre>
117
118
*settings.gradle:*
119
<pre>
120
rootProject.name = projectName
121
</pre>