Project

General

Profile

Services » History » Version 6

Alexey Demakov, 08/08/2018 04:54 PM

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