Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
1366c31d
Unverified
Commit
1366c31d
authored
Aug 04, 2020
by
Kvakos
Committed by
GitHub
Aug 03, 2020
Browse files
Added buildCoverageRegex and buildGitStrategy properties to Project (#600)
parent
ce7f5e9b
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/Constants.java
View file @
1366c31d
...
...
@@ -825,5 +825,28 @@ public interface Constants {
return
(
enumHelper
.
toString
(
this
));
}
}
/** Enum for the build_git_strategy of the project instance. */
enum
BuildGitStrategy
{
FETCH
,
CLONE
;
private
static
JacksonJsonEnumHelper
<
BuildGitStrategy
>
enumHelper
=
new
JacksonJsonEnumHelper
<>(
BuildGitStrategy
.
class
);
@JsonCreator
public
static
BuildGitStrategy
forValue
(
String
value
)
{
return
enumHelper
.
forValue
(
value
);
}
@JsonValue
public
String
toValue
()
{
return
(
enumHelper
.
toString
(
this
));
}
@Override
public
String
toString
()
{
return
(
enumHelper
.
toString
(
this
));
}
}
}
src/main/java/org/gitlab4j/api/ImportExportApi.java
View file @
1366c31d
...
...
@@ -236,7 +236,9 @@ public class ImportExportApi extends AbstractApi {
.
withParam
(
"printing_merge_request_link_enabled"
,
overrideParams
.
getPrintingMergeRequestLinkEnabled
())
.
withParam
(
"resolve_outdated_diff_discussions"
,
overrideParams
.
getResolveOutdatedDiffDiscussions
())
.
withParam
(
"initialize_with_readme"
,
overrideParams
.
getInitializeWithReadme
())
.
withParam
(
"packages_enabled"
,
overrideParams
.
getPackagesEnabled
());
.
withParam
(
"packages_enabled"
,
overrideParams
.
getPackagesEnabled
())
.
withParam
(
"build_git_strategy"
,
overrideParams
.
getBuildGitStrategy
())
.
withParam
(
"build_coverage_regex"
,
overrideParams
.
getBuildCoverageRegex
());
}
Response
response
=
upload
(
Response
.
Status
.
CREATED
,
"file"
,
exportFile
,
null
,
formData
,
url
);
...
...
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
1366c31d
...
...
@@ -953,6 +953,8 @@ public class ProjectApi extends AbstractApi implements Constants {
* resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push
* initialize_with_readme (optional) - Initialize project with README file
* packagesEnabled (optional) - Enable or disable mvn packages repository feature
* buildGitStrategy (optional) - set the build git strategy
* buildCoverageRegex (optional) - set build coverage regex
*
* @param project the Project instance with the configuration for the new project
* @param importUrl the URL to import the repository from
...
...
@@ -997,7 +999,9 @@ public class ProjectApi extends AbstractApi implements Constants {
.
withParam
(
"printing_merge_request_link_enabled"
,
project
.
getPrintingMergeRequestLinkEnabled
())
.
withParam
(
"resolve_outdated_diff_discussions"
,
project
.
getResolveOutdatedDiffDiscussions
())
.
withParam
(
"initialize_with_readme"
,
project
.
getInitializeWithReadme
())
.
withParam
(
"packages_enabled"
,
project
.
getPackagesEnabled
());
.
withParam
(
"packages_enabled"
,
project
.
getPackagesEnabled
())
.
withParam
(
"build_git_strategy"
,
project
.
getBuildGitStrategy
())
.
withParam
(
"build_coverage_regex"
,
project
.
getBuildCoverageRegex
());
Namespace
namespace
=
project
.
getNamespace
();
if
(
namespace
!=
null
&&
namespace
.
getId
()
!=
null
)
{
...
...
@@ -1197,6 +1201,8 @@ public class ProjectApi extends AbstractApi implements Constants {
* printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line
* resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push
* packagesEnabled (optional) - Enable or disable mvn packages repository feature
* buildGitStrategy (optional) - set the build git strategy
* buildCoverageRegex (optional) - set build coverage regex
*
* NOTE: The following parameters specified by the GitLab API edit project are not supported:
* import_url
...
...
@@ -1240,7 +1246,9 @@ public class ProjectApi extends AbstractApi implements Constants {
.
withParam
(
"approvals_before_merge"
,
project
.
getApprovalsBeforeMerge
())
.
withParam
(
"printing_merge_request_link_enabled"
,
project
.
getPrintingMergeRequestLinkEnabled
())
.
withParam
(
"resolve_outdated_diff_discussions"
,
project
.
getResolveOutdatedDiffDiscussions
())
.
withParam
(
"packages_enabled"
,
project
.
getPackagesEnabled
());
.
withParam
(
"packages_enabled"
,
project
.
getPackagesEnabled
())
.
withParam
(
"build_git_strategy"
,
project
.
getBuildGitStrategy
())
.
withParam
(
"build_coverage_regex"
,
project
.
getBuildCoverageRegex
());
if
(
isApiVersion
(
ApiVersion
.
V3
))
{
formData
.
withParam
(
"visibility_level"
,
project
.
getVisibilityLevel
());
...
...
src/main/java/org/gitlab4j/api/models/Project.java
View file @
1366c31d
...
...
@@ -12,6 +12,8 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import
com.fasterxml.jackson.annotation.JsonValue
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
org.gitlab4j.api.Constants.BuildGitStrategy
;
public
class
Project
{
// Enum for the merge_method of the Project instance.
...
...
@@ -90,6 +92,8 @@ public class Project {
private
String
licenseUrl
;
private
ProjectLicense
license
;
private
List
<
CustomAttribute
>
customAttributes
;
private
String
buildCoverageRegex
;
private
BuildGitStrategy
buildGitStrategy
;
@JsonSerialize
(
using
=
JacksonJson
.
DateOnlySerializer
.
class
)
private
Date
markedForDeletionOn
;
...
...
@@ -706,4 +710,30 @@ public class Project {
public
static
final
String
getPathWithNammespace
(
String
namespace
,
String
path
)
{
return
(
namespace
.
trim
()
+
"/"
+
path
.
trim
());
}
public
String
getBuildCoverageRegex
()
{
return
buildCoverageRegex
;
}
public
void
setBuildCoverageRegex
(
String
buildCoverageRegex
)
{
this
.
buildCoverageRegex
=
buildCoverageRegex
;
}
public
Project
withBuildCoverageRegex
(
String
buildCoverageRegex
)
{
this
.
buildCoverageRegex
=
buildCoverageRegex
;
return
this
;
}
public
BuildGitStrategy
getBuildGitStrategy
()
{
return
buildGitStrategy
;
}
public
void
setBuildGitStrategy
(
BuildGitStrategy
buildGitStrategy
)
{
this
.
buildGitStrategy
=
buildGitStrategy
;
}
public
Project
withBuildGitStrategy
(
BuildGitStrategy
buildGitStrategy
)
{
this
.
buildGitStrategy
=
buildGitStrategy
;
return
this
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment