Skip to content

Commit b2e61e8

Browse files
author
BFT\a.rogalskii
committed
Added info on workflows
Updates on github-actions
1 parent 4da1593 commit b2e61e8

File tree

18 files changed

+538
-2
lines changed

18 files changed

+538
-2
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ before_script:
2020
- ./gradlew --version
2121

2222
script:
23-
- ./gradlew clean build -i --continue
23+
- ./gradlew clean spotlessApply build -i --continue
24+
# - ./gradlew check assemble --stacktrace -Dtests.slow=true
2425

2526
after_success:
2627
- if [ -n "$CODECOV_ENABLED" ]; then bash <(curl -s --retry 5 --retry-delay 2 --connect-timeout 2 https://codecov.io/bash) -t $CODECOV_TOKEN; fi
27-
# - ./gradlew cobertura coveralls
28+
# - ./gradlew cobertura coveralls
2829
- ./gradlew jacocoTestReport coveralls
2930
# - ./gradlew pitest coveralls
3031

@@ -43,6 +44,8 @@ notifications:
4344
before_cache:
4445
- rm -rf $HOME/.gradle/repository/
4546
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
47+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
48+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
4649

4750
cache:
4851
directories:

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ subprojects {
277277
attributes("Build-Time": project.buildTime)
278278
attributes("Specification-Title": projectConfig.module)
279279
attributes("Specification-Version": project.version)
280+
attributes("Implementation-URL": projectConfig.url)
280281
attributes("Implementation-Title": projectConfig.module)
281282
attributes("Implementation-Version": project.version)
282283
attributes("Created-By": projectConfig.vendor)

buildSrc/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ ext.versions = [
1818
"gradle_versions" : "0.28.0",
1919
"gradle_sonarqube": "2.8",
2020
"gradle_dokka" : "1.4.10",
21+
"palantir" : "1.24.0",
2122
"semver4j" : "3.1.0",
23+
"spotless" : "4.5.1",
24+
"jmh" : "0.5.0",
25+
"forbiddenapis" : "3.0.1",
2226
"gradle_nexus" : "0.22.0"
2327
]
2428
ext.deps = [
@@ -34,6 +38,10 @@ ext.deps = [
3438
"gradle_sonarqube": "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:${versions.gradle_sonarqube}",
3539
"gradle_dokka" : "org.jetbrains.dokka:dokka-gradle-plugin:${versions.gradle_dokka}",
3640
"semver4j" : "com.vdurmont:semver4j:${versions.semver4j}",
41+
"spotless" : "com.diffplug.gradle.spotless:${versions.spotless}",
42+
"jmh" : "me.champeau.gradle.jmh:${versions.jmh}",
43+
"palantir" : "com.palantir.consistent-versions:${versions.palantir}",
44+
"forbiddenapis" : "de.thetaphi.forbiddenapis:${versions.forbiddenapis}",
3745
"gradle_nexus" : "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:${versions.gradle_nexus}"
3846
]
3947

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package git
2+
3+
buildscript {
4+
repositories {
5+
mavenCentral()
6+
}
7+
8+
dependencies {
9+
classpath 'org.eclipse.jgit:org.eclipse.jgit:5.3.0.201903130848-r'
10+
classpath 'commons-codec:commons-codec:1.6'
11+
}
12+
}
13+
14+
/** Return the current checkout's status. */
15+
def gitStatus(dir) {
16+
def status = [
17+
abbrRev: "[unset]",
18+
fullRev: "[unset]",
19+
clean : false,
20+
branch : "[unset]",
21+
id : "[unset]"
22+
]
23+
24+
try {
25+
def repo = new FileRepositoryBuilder()
26+
.findGitDir(file(dir))
27+
.build()
28+
def git = new Git(repo)
29+
def head = repo.findRef("HEAD")
30+
31+
def st = git.status().call()
32+
def commit = head.getObjectId()
33+
status.fullRev = commit.name()
34+
status.abbrRev = commit.abbreviate(8).name()
35+
status.clean = st.clean
36+
status.branch = repo.branch
37+
38+
status.id = status.branch + "/" + status.abbrRev
39+
if (!status.clean) {
40+
status.id += '-dirty'
41+
42+
logger.warn("Git status indicates dirty checkout (run with --info for verbose git status)")
43+
logger.info("Git status is: added={}, changed={}, conflicting={}, ignored={}, missing={}, modified={}, removed={}, untracked={}, untrackedFolders={}",
44+
st.added,
45+
st.changed,
46+
st.conflicting,
47+
st.ignoredNotInIndex,
48+
st.missing,
49+
st.modified,
50+
st.removed,
51+
st.untracked,
52+
st.untrackedFolders);
53+
}
54+
} catch (Exception e) {
55+
throw e // Break the build if not under a repo.
56+
}
57+
58+
return status
59+
}
60+
61+
ext.gitStatus = gitStatus(".")
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package ide
2+
// Try to detect IntelliJ model loader ("reimport") early.
3+
def isIdea = System.getProperty("idea.active") != null ||
4+
gradle.startParameter.taskNames.contains('idea') ||
5+
gradle.startParameter.taskNames.contains('cleanIdea')
6+
7+
if (isIdea) {
8+
logger.warn("IntelliJ Idea IDE detected.")
9+
}
10+
11+
allprojects {
12+
apply plugin: 'idea'
13+
14+
idea {
15+
module {
16+
outputDir file('build/idea/classes/main')
17+
testOutputDir file('build/idea/classes/test')
18+
downloadSources = true
19+
}
20+
}
21+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package java
2+
3+
configure(rootProject) {
4+
sourceCompatibility = JavaVersion.VERSION_1_8
5+
targetCompatibility = sourceCompatibility
6+
}
7+
8+
allprojects {
9+
plugins.withType(JavaPlugin) {
10+
tasks.withType(JavaCompile) {
11+
sourceCompatibility = rootProject.sourceCompatibility
12+
targetCompatibility = rootProject.sourceCompatibility
13+
options.encoding = "UTF-8"
14+
15+
options.compilerArgs += [
16+
"--release", "8",
17+
"-Xlint:unchecked",
18+
"-Xlint:deprecation",
19+
"-proc:none",
20+
"-Werror",
21+
]
22+
}
23+
24+
tasks.jar {
25+
manifest {
26+
attributes([
27+
'Automatic-Module-Name' : "com.carrotsearch.${project.name.replace('-', '.')}",
28+
"Implementation-Vendor" : "Carrot Search s.c. and contributors",
29+
"Implementation-Title" : "${project.name}",
30+
"Implementation-Version": "${project.version}"
31+
])
32+
}
33+
}
34+
}
35+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package java
2+
3+
allprojects {
4+
plugins.withType(JavaPlugin) {
5+
tasks.withType(Javadoc) {
6+
options.encoding = 'UTF-8'
7+
title = "${project.name} ${project.version} API Documentation"
8+
9+
options.addBooleanOption('html5', true)
10+
options.addBooleanOption('Xdoclint:all,-missing', true)
11+
options.noIndex()
12+
}
13+
}
14+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package java
2+
3+
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
4+
import org.gradle.api.tasks.testing.logging.TestLogEvent
5+
6+
allprojects {
7+
plugins.withType(JavaPlugin) {
8+
test {
9+
maxParallelForks = propertyOrDefault("tests.jvms",
10+
(int) Math.max(1, Math.min(Runtime.runtime.availableProcessors() / 2.0, 4.0))) as Integer
11+
12+
useJUnit()
13+
14+
minHeapSize = propertyOrDefault("tests.minheapsize", "256m")
15+
maxHeapSize = propertyOrDefault("tests.heapsize", "512m")
16+
17+
testLogging {
18+
events TestLogEvent.FAILED
19+
exceptionFormat TestExceptionFormat.FULL
20+
showExceptions true
21+
showCauses true
22+
showStackTraces true
23+
stackTraceFilters.clear()
24+
showStandardStreams false
25+
}
26+
}
27+
}
28+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package misc
2+
3+
allprojects {
4+
ext {
5+
// Utility method to support passing overrides via -P or -D.
6+
propertyOrDefault = { propName, defValue ->
7+
def result
8+
if (project.hasProperty(propName)) {
9+
result = project.getProperty(propName)
10+
} else if (System.properties.containsKey(propName)) {
11+
result = System.properties.get(propName)
12+
} else {
13+
result = defValue
14+
}
15+
return result
16+
}
17+
}
18+
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
package publishing
2+
3+
configure(rootProject) {
4+
ext {
5+
published = [
6+
":hppc",
7+
]
8+
}
9+
10+
configure(subprojects.findAll { it.path in rootProject.published }) {
11+
apply plugin: 'maven-publish'
12+
apply plugin: 'signing'
13+
14+
tasks.withType(GenerateModuleMetadata) {
15+
enabled = false
16+
}
17+
18+
plugins.withType(JavaPlugin) {
19+
publishing {
20+
repositories {
21+
maven {
22+
name = 'sonatype'
23+
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
24+
25+
credentials {
26+
if (project.hasProperty('nexusUsername')) {
27+
username project.nexusUsername
28+
}
29+
if (project.hasProperty('nexusPassword')) {
30+
password project.nexusPassword
31+
}
32+
}
33+
}
34+
}
35+
}
36+
37+
task sourcesJar(type: Jar, dependsOn: classes) {
38+
archiveClassifier = 'sources'
39+
from sourceSets.main.allJava
40+
}
41+
42+
task javadocJar(type: Jar, dependsOn: javadoc) {
43+
archiveClassifier = 'javadoc'
44+
from javadoc.destinationDir
45+
}
46+
47+
publishing {
48+
def configurePom = {
49+
name = "High Performance Primitive Collections"
50+
url = "https://github.com/carrotsearch/hppc"
51+
description = "High Performance Primitive Collections: " +
52+
"data structures (maps, sets, lists, stacks, queues) generated " +
53+
"for combinations of object and primitive types to conserve JVM " +
54+
"memory and speed up execution."
55+
56+
licenses {
57+
license {
58+
name = 'Apache 2'
59+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
60+
}
61+
}
62+
63+
organization {
64+
name = "Carrot Search s.c."
65+
url = "https://www.carrotsearch.com"
66+
}
67+
68+
developers {
69+
developer {
70+
id = 'stanislaw.osinski'
71+
name = 'Stanisław Osiński'
72+
73+
}
74+
developer {
75+
id = 'dawid.weiss'
76+
name = 'Dawid Weiss'
77+
78+
}
79+
developer {
80+
id = 'bruno.roustant'
81+
name = 'Bruno Roustant'
82+
83+
}
84+
}
85+
86+
scm {
87+
connection = 'scm:git:[email protected]:carrotsearch/hppc.git'
88+
developerConnection = 'scm:git:[email protected]:carrotsearch/hppc.git'
89+
url = 'https://github.com/carrotsearch/hppc'
90+
}
91+
}
92+
93+
publications {
94+
signed(MavenPublication) {
95+
from components.java
96+
groupId = project.group
97+
artifactId = project.archivesBaseName
98+
99+
artifact sourcesJar
100+
artifact javadocJar
101+
102+
pom(configurePom)
103+
}
104+
}
105+
}
106+
107+
signing {
108+
sign publishing.publications.signed
109+
}
110+
}
111+
}
112+
}

0 commit comments

Comments
 (0)