Project

General

Profile

Services » History » Version 2

Alexey Demakov, 01/21/2016 01:33 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
project.group = projectGroup
37
38
release {
39
  failOnCommitNeeded = false
40
41
  versionPatterns = [
42
    // Increments build number: "0.2.5-alpha-150428" => "0.2.6-alpha-150428"
43
    /(^\d+\.\d+\.)(\d+)(-[^-]*)(-[^-]*$)/: 
44
    { Matcher m, Project p -> m.replaceAll("${ m[0][1] }${ (m[0][2] as int) + 1 }${ m[0][3] }" ) }
45
  ]
46
}
47
48
String getCurrentDateString()  {
49
  new SimpleDateFormat( ''yyMMdd'' ).format( new Date() )
50
}
51
52
task unSnapshotVersion.doLast {
53
  def version = project.version.toString()
54
  version += ''-'' + getCurrentDateString()
55
   project.plugins.getPlugin( net.researchgate.release.ReleasePlugin.class )
56
  .updateVersionProperty( version )
57
}
58
59
publishing {
60
  publications {
61
    maven(MavenPublication) {
62
      groupId projectGroup
63
      artifactId projectName
64
      version project.version
65
66
      from components.java
67
    }
68
  }
69
  repositories {
70
    maven {
71
      if(project.version.endsWith(''-SNAPSHOT'')) {
72
        url ''http://forge.ispras.ru:8082/nexus/content/repositories/snapshots''
73
      } else {
74
        url ''http://forge.ispras.ru:8082/nexus/content/repositories/releases''
75
      }
76
      credentials {
77
        username hasProperty(''repoUser'') ? repoUser : ''''
78
        password hasProperty(''repoPassword'') ? repoPassword : ''''
79
      }
80
      authentication {
81
        basic(BasicAuthentication)
82
      }
83
    }
84
  }
85
}
86
87
afterReleaseBuild.dependsOn publish
88
</pre>
89
90
*gradle.properties:*
91
<pre>
92
projectGroup=...
93
projectName=..
94
# gradle-release-plugin restriction: use only ''='' as separator
95
version=...
96
</pre>
97
98
*gradle-local.properties:*
99
<pre>repoUser=...
100
repoPassword=...
101
</pre>
102
103
*.gitignore:*
104
<pre>
105
gradle-local.properties
106
</pre>
107
108
*settings.gradle:*
109
<pre>
110
rootProject.name = projectName
111
</pre>