forked from gradle/gradle
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add progress event for problem api events (gradle#32328)
- Loading branch information
Showing
36 changed files
with
1,151 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...enterprise-operations/src/main/java/org/gradle/operations/problems/DocumentationLink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.operations.problems; | ||
|
||
/** | ||
* A link to a documentation page. | ||
* | ||
* @since 8.14 | ||
*/ | ||
public interface DocumentationLink { | ||
|
||
/** | ||
* The URL of the documentation page. | ||
* | ||
* @since 8.14 | ||
*/ | ||
String getUrl(); | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...rise/enterprise-operations/src/main/java/org/gradle/operations/problems/FileLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.operations.problems; | ||
|
||
/** | ||
* A file location. | ||
* | ||
* @since 8.14 | ||
*/ | ||
public interface FileLocation extends ProblemLocation { | ||
|
||
// TODO: Add getFileType() - build logic file, software definition, application code | ||
|
||
/** | ||
* The absolute path of the file. | ||
* | ||
* @since 8.14 | ||
*/ | ||
String getPath(); | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
...nterprise-operations/src/main/java/org/gradle/operations/problems/LineInFileLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.operations.problems; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* A basic location pointing to a specific part of a file using line number, column, and length for coordinates. | ||
* <p> | ||
* The line and column coordinates are one-indexed so that they can be easily matched to the content of a UI editor interface. | ||
* | ||
* @since 8.14 | ||
*/ | ||
public interface LineInFileLocation extends FileLocation { | ||
|
||
/** | ||
* The line number within the file. | ||
* <p> | ||
* The line is <b>one-indexed</b>, i.e. the first line in the file is line number 1. | ||
* | ||
* @since 8.14 | ||
*/ | ||
int getLine(); | ||
|
||
/** | ||
* The starting column on the selected line. | ||
* <p> | ||
* The column is <b>one-indexed</b>, i.e. the first column in the file is line number 1. | ||
* Null indicates that the column information is not available. | ||
* | ||
* @since 8.14 | ||
*/ | ||
@Nullable | ||
Integer getColumn(); | ||
|
||
/** | ||
* The length of the selected content starting from specified column. | ||
* Null indicates that the column information is not available. | ||
* | ||
* @return the length | ||
* @since 8.14 | ||
*/ | ||
@Nullable | ||
Integer getLength(); | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
...erprise-operations/src/main/java/org/gradle/operations/problems/OffsetInFileLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.operations.problems; | ||
|
||
/** | ||
* A basic location pointing to a specific part of a file using a global offset and length for coordinates. | ||
* <p> | ||
* The coordinates are expected to be zero indexed. | ||
* | ||
* @since 8.14 | ||
*/ | ||
public interface OffsetInFileLocation extends FileLocation { | ||
|
||
/** | ||
* The global offset from the beginning of the file. | ||
* | ||
* @return the zero-indexed the offset | ||
* @since 8.14 | ||
*/ | ||
int getOffset(); | ||
|
||
/** | ||
* The length of the content starting from {@link #getOffset()}. | ||
* | ||
* @since 8.14 | ||
*/ | ||
int getLength(); | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
.../enterprise-operations/src/main/java/org/gradle/operations/problems/PluginIdLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.operations.problems; | ||
|
||
/** | ||
* Gradle Plugin ID location. | ||
* | ||
* @since 8.14 | ||
*/ | ||
public interface PluginIdLocation extends ProblemLocation { | ||
|
||
/** | ||
* The plugin ID. | ||
* | ||
* @since 8.14 | ||
*/ | ||
String getPluginId(); | ||
|
||
} |
72 changes: 72 additions & 0 deletions
72
...enterprise-operations/src/main/java/org/gradle/operations/problems/ProblemDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright 2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.operations.problems; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* Describes a specific problem without a concrete usage. | ||
* <p> | ||
* For example, in the domain of Java compilation problems, an unused variable warning could be described as such: | ||
* <ul> | ||
* <li>group: compilation:java</li> | ||
* <li>unused variable</li> | ||
* <li>severity: WARNING</li> | ||
* <li>...</li> | ||
* </ul> | ||
* <p> | ||
* The group and the name uniquely identify the problem definition, the remaining fields only supply additional information. | ||
* | ||
* @since 8.14 | ||
*/ | ||
public interface ProblemDefinition { | ||
|
||
/** | ||
* The name of the problem. | ||
* <p> | ||
* The name should be used to categorize a set of problems. | ||
* The name itself does not need to be unique, the uniqueness is determined the name and the group hierarchy. | ||
* | ||
* @since 8.14 | ||
*/ | ||
String getName(); | ||
|
||
/** | ||
* A human-readable label describing the problem ID. | ||
* <p> | ||
* The display name should be used to present the problem to the user. | ||
* | ||
* @since 8.14 | ||
*/ | ||
String getDisplayName(); | ||
|
||
/** | ||
* The group of the problem. | ||
* | ||
* @since 8.14 | ||
*/ | ||
ProblemGroup getGroup(); | ||
|
||
/** | ||
* A link to the documentation for this problem. | ||
* | ||
* @since 8.14 | ||
*/ | ||
@Nullable | ||
DocumentationLink getDocumentationLink(); | ||
|
||
} |
Oops, something went wrong.