Project

General

Profile

Services » History » Version 3

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