Skip to content

Commit 05b2cb7

Browse files
Merge branch '6.x' into addMissingDeploymentAndEnviormentAttributes
# Conflicts: # src/main/java/org/gitlab4j/api/models/Environment.java # src/test/java/org/gitlab4j/api/TestGitLabApiEvents.java
2 parents 4844253 + eb66036 commit 05b2cb7

File tree

406 files changed

+29551
-21775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

406 files changed

+29551
-21775
lines changed

.github/workflows/ci-build.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,21 @@ on:
99

1010
jobs:
1111

12-
build-jdk11:
13-
name: "Build JDK 11"
12+
build-gradle:
13+
name: "Build"
1414
runs-on: ubuntu-latest
15-
services:
16-
gitlab-instance:
17-
image: gitlab/gitlab-ce:12.9.2-ce.0
18-
env:
19-
GITLAB_OMNIBUS_CONFIG: gitlab_rails['initial_root_password']="password";gitlab_rails['lfs_enabled']=false;
20-
ports:
21-
- 8090:80
2215
steps:
23-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
2417
with:
2518
fetch-depth: 0
26-
- name: Set up JDK 11
27-
uses: actions/setup-java@v2
19+
- name: Setup JDK 11
20+
uses: actions/setup-java@v3
2821
with:
29-
distribution: adopt-hotspot
22+
distribution: temurin
3023
java-version: 11
31-
- name: Get Date
32-
id: get-date
33-
run: |
34-
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
35-
shell: bash
36-
- name: Cache Maven Repository
37-
id: cache-maven
38-
uses: actions/cache@v2
39-
with:
40-
path: ~/.m2/repository
41-
# refresh cache every month to avoid unlimited growth
42-
key: gitlab4jmaven-${{ steps.get-date.outputs.date }}
24+
- name: Setup Gradle
25+
uses: gradle/actions/setup-gradle@v3
4326
- name: GitLab4j verify
4427
id: gitlab4j-verify
4528
run: |
46-
./mvnw verify -B -V
29+
./gradlew build --console=PLAIN --stacktrace
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "Validate Gradle Wrapper"
2+
on: [push, pull_request]
3+
4+
jobs:
5+
validation:
6+
name: "Gradle wrapper validation"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: gradle/actions/wrapper-validation@v4

.mvn/wrapper/maven-wrapper.jar

-49.5 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To utilize GitLab4J™ API in your Java project, simply add the following de
5353
```java
5454
dependencies {
5555
...
56-
compile group: 'org.gitlab4j', name: 'gitlab4j-api', version: '6.0.0-rc.5'
56+
compile group: 'org.gitlab4j', name: 'gitlab4j-api', version: '6.0.0-rc.6'
5757
}
5858
```
5959

@@ -64,7 +64,7 @@ dependencies {
6464
<dependency>
6565
<groupId>org.gitlab4j</groupId>
6666
<artifactId>gitlab4j-api</artifactId>
67-
<version>6.0.0-rc.5</version>
67+
<version>6.0.0-rc.6</version>
6868
</dependency>
6969
```
7070

@@ -75,7 +75,7 @@ dependencies {
7575
Just add this line at the top of your script:
7676

7777
```java
78-
//DEPS org.gitlab4j:gitlab4j-api:6.0.0-rc.5
78+
//DEPS org.gitlab4j:gitlab4j-api:6.0.0-rc.6
7979
```
8080

8181
**Ivy and SBT**<br/>
@@ -636,7 +636,7 @@ List<Runner> runners = gitLabApi.getRunnersApi().getAllRunners();
636636
#### SearchApi
637637
```java
638638
// Do a global search for Projects
639-
List<?> projects = gitLabApi.getSearchApi().globalSearch(SearchScope.PROJECTS, "text-to-search-for");
639+
List<Project> projects = gitLabApi.getSearchApi().globalSearch(SearchScope.PROJECTS, "text-to-search-for");
640640
```
641641

642642
#### ServicesApi

build.gradle

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
2+
plugins {
3+
id 'java-library'
4+
id 'com.diffplug.spotless' version '6.25.0'
5+
id 'signing'
6+
id 'maven-publish'
7+
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
8+
id 'net.researchgate.release' version '3.0.2'
9+
}
10+
11+
wrapper {
12+
gradleVersion = '7.6.2'
13+
}
14+
15+
group = 'org.gitlab4j'
16+
17+
dependencies {
18+
api 'jakarta.activation:jakarta.activation-api:2.1.1'
19+
api 'org.glassfish.jersey.inject:jersey-hk2:3.1.1'
20+
api 'org.glassfish.jersey.core:jersey-client:3.1.1'
21+
api 'org.glassfish.jersey.connectors:jersey-apache-connector:3.1.1'
22+
api 'org.glassfish.jersey.media:jersey-media-multipart:3.1.1'
23+
api 'org.glassfish.jersey.media:jersey-media-json-jackson:3.1.1'
24+
api 'jakarta.servlet:jakarta.servlet-api:6.0.0'
25+
testImplementation 'org.mockito:mockito-core:5.2.0'
26+
testImplementation 'org.mockito:mockito-junit-jupiter:5.2.0'
27+
testImplementation 'org.hamcrest:hamcrest-all:1.3'
28+
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.2'
29+
testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.4"
30+
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.4"
31+
}
32+
33+
signing {
34+
useGpgCmd()
35+
sign(publishing.publications)
36+
}
37+
38+
tasks.withType(Sign) {
39+
onlyIf {
40+
project.hasProperty('signing.gnupg.keyName')
41+
}
42+
}
43+
44+
java {
45+
withJavadocJar()
46+
withSourcesJar()
47+
48+
compileJava.options.encoding = "UTF-8"
49+
toolchain {
50+
languageVersion = JavaLanguageVersion.of(11)
51+
}
52+
}
53+
54+
tasks.named('test') {
55+
useJUnitPlatform()
56+
}
57+
58+
repositories {
59+
mavenCentral()
60+
}
61+
62+
spotless {
63+
java {
64+
palantirJavaFormat()
65+
importOrder 'java', 'javax', 'jakarta', 'org', 'com', ''
66+
removeUnusedImports()
67+
}
68+
}
69+
70+
nexusPublishing {
71+
packageGroup = 'org.gitlab4j'
72+
repositories {
73+
sonatype {
74+
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
75+
username = project.findProperty('ossSonatypeUsername') ?: ''
76+
password = project.findProperty('ossSonatypePassword') ?: ''
77+
}
78+
}
79+
}
80+
81+
publishing {
82+
publications {
83+
mavenJava(MavenPublication) {
84+
pom {
85+
name = 'GitLab4J-API - GitLab API Java Client'
86+
description = 'GitLab4J-API (gitlab4j-api) provides a full featured Java client library for working with GitLab repositories and servers via the GitLab REST API.'
87+
packaging = 'jar'
88+
url = 'https://' + "$githubRepositoryOwner" + '.github.io/' + "$githubRepositoryName" + '/'
89+
licenses {
90+
license {
91+
name = 'The MIT License (MIT)'
92+
url = 'http://opensource.org/licenses/MIT'
93+
distribution = 'repo'
94+
}
95+
}
96+
developers {
97+
developer {
98+
id = 'gmessner'
99+
name = 'Greg Messner'
100+
101+
}
102+
developer {
103+
id = 'gdesaintmartinlacaze'
104+
name = 'Gautier de Saint Martin Lacaze'
105+
106+
}
107+
developer {
108+
url = 'https://github.com/orgs/' + "$githubRepositoryOwner" + '/people'
109+
}
110+
}
111+
scm {
112+
connection = 'scm:git:https://github.com/' + "$githubRepositoryOwner" + '/' + "$githubRepositoryName" + '.git'
113+
developerConnection = 'scm:git:https://github.com/' + "$githubRepositoryOwner" + '/' + "$githubRepositoryName" + '.git'
114+
url = 'https://github.com/' + "$githubRepositoryOwner" + '/' + "$githubRepositoryName" + '/'
115+
}
116+
}
117+
from components.java
118+
}
119+
}
120+
}
121+
122+
release {
123+
buildTasks = ['doRelease']
124+
git {
125+
requireBranch.set('6.x')
126+
}
127+
}
128+
129+
def checkLastVersionValueTask = tasks.register('checkLastVersionValue') {
130+
doLast {
131+
if(version.endsWith('SNAPSHOT')) {
132+
throw new GradleException("version '$version' ends with SNAPSHOT, this is not a release build!")
133+
}
134+
if(lastVersion != version) {
135+
throw new GradleException("lastVersion '$lastVersion' does not match version '$version', fix it in the 'gradle.properties' file.")
136+
}
137+
}
138+
}
139+
140+
def updateLastVersionValueTask = tasks.register('updateLastVersionValue') {
141+
doLast {
142+
def propertiesFile = file('gradle.properties')
143+
def content = propertiesFile.text
144+
def newVersion = project.findProperty('release.releaseVersion') ?: version.replace('-SNAPSHOT', '')
145+
content = content.replaceAll("lastVersion=[0-9a-z\\.\\-]+", "lastVersion=" + newVersion)
146+
propertiesFile.text = content
147+
}
148+
}
149+
150+
tasks.register('doRelease') {
151+
dependsOn(
152+
checkLastVersionValueTask,
153+
'initializeSonatypeStagingRepository',
154+
'clean',
155+
'build',
156+
project.getTasksByName('publishToSonatype', true)
157+
)
158+
}
159+
160+
model {
161+
tasks.unSnapshotVersion {
162+
dependsOn updateLastVersionValueTask
163+
}
164+
}

gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version=6.0.0-SNAPSHOT
2+
lastVersion=6.0.0-rc.6
3+
4+
githubRepositoryOwner=gitlab4j
5+
githubRepositoryName=gitlab4j-api

gradle/wrapper/gradle-wrapper.jar

60.2 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
4+
networkTimeout=10000
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)