Project

General

Profile

Services » History » Version 2

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

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