-
Notifications
You must be signed in to change notification settings - Fork 3k
Changed Gradle project templates to use the platform BOM properties, … #5012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aloubyansky
merged 1 commit into
quarkusio:master
from
aloubyansky:gradle-template-fixes
Oct 30, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
117 changes: 117 additions & 0 deletions
117
devtools/gradle/src/main/java/io/quarkus/gradle/GradleDependencyArtifact.java
This file contains hidden or 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,117 @@ | ||
package io.quarkus.gradle; | ||
|
||
import org.gradle.api.artifacts.DependencyArtifact; | ||
|
||
public class GradleDependencyArtifact implements DependencyArtifact { | ||
|
||
private String classifier; | ||
private String extension; | ||
private String name; | ||
private String type; | ||
private String url; | ||
|
||
@Override | ||
public String getClassifier() { | ||
return classifier; | ||
} | ||
|
||
@Override | ||
public String getExtension() { | ||
return extension; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
@Override | ||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
@Override | ||
public void setClassifier(String arg0) { | ||
this.classifier = arg0; | ||
} | ||
|
||
@Override | ||
public void setExtension(String arg0) { | ||
this.extension = arg0; | ||
} | ||
|
||
@Override | ||
public void setName(String arg0) { | ||
this.name = arg0; | ||
} | ||
|
||
@Override | ||
public void setType(String arg0) { | ||
this.type = arg0; | ||
} | ||
|
||
@Override | ||
public void setUrl(String arg0) { | ||
this.url = arg0; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((classifier == null) ? 0 : classifier.hashCode()); | ||
result = prime * result + ((extension == null) ? 0 : extension.hashCode()); | ||
result = prime * result + ((name == null) ? 0 : name.hashCode()); | ||
result = prime * result + ((type == null) ? 0 : type.hashCode()); | ||
result = prime * result + ((url == null) ? 0 : url.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
GradleDependencyArtifact other = (GradleDependencyArtifact) obj; | ||
if (classifier == null) { | ||
if (other.classifier != null) | ||
return false; | ||
} else if (!classifier.equals(other.classifier)) | ||
return false; | ||
if (extension == null) { | ||
if (other.extension != null) | ||
return false; | ||
} else if (!extension.equals(other.extension)) | ||
return false; | ||
if (name == null) { | ||
if (other.name != null) | ||
return false; | ||
} else if (!name.equals(other.name)) | ||
return false; | ||
if (type == null) { | ||
if (other.type != null) | ||
return false; | ||
} else if (!type.equals(other.type)) | ||
return false; | ||
if (url == null) { | ||
if (other.url != null) | ||
return false; | ||
} else if (!url.equals(other.url)) | ||
return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "GradleDepArtifact [classifier=" + classifier + ", extension=" + extension + ", name=" + name + ", type=" + type | ||
+ ", url=" + url + "]"; | ||
} | ||
} |
This file contains hidden or 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
39 changes: 39 additions & 0 deletions
39
devtools/gradle/src/main/java/io/quarkus/gradle/tasks/GradleMessageWriter.java
This file contains hidden or 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,39 @@ | ||
package io.quarkus.gradle.tasks; | ||
|
||
import org.gradle.api.logging.Logger; | ||
|
||
import io.quarkus.platform.tools.MessageWriter; | ||
|
||
public class GradleMessageWriter implements MessageWriter { | ||
|
||
private final Logger logger; | ||
|
||
public GradleMessageWriter(Logger logger) { | ||
this.logger = logger; | ||
} | ||
|
||
@Override | ||
public void debug(String arg0) { | ||
logger.debug(arg0); | ||
} | ||
|
||
@Override | ||
public void error(String arg0) { | ||
logger.error(arg0); | ||
} | ||
|
||
@Override | ||
public void info(String arg0) { | ||
logger.info(arg0); | ||
} | ||
|
||
@Override | ||
public boolean isDebugEnabled() { | ||
return logger.isDebugEnabled(); | ||
} | ||
|
||
@Override | ||
public void warn(String arg0) { | ||
logger.warn(arg0); | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
/** | ||
* @author <a href="mailto:[email protected]">Ståle Pedersen</a> | ||
*/ | ||
public class QuarkusAddExtension extends QuarkusTask { | ||
public class QuarkusAddExtension extends QuarkusPlatformTask { | ||
|
||
public QuarkusAddExtension() { | ||
super("Adds Quarkus extensions specified by the user to the project."); | ||
|
@@ -37,6 +37,9 @@ public List<String> getExtensionsToAdd() { | |
|
||
@TaskAction | ||
public void addExtension() { | ||
|
||
setupPlatformDescriptor(); | ||
|
||
Set<String> extensionsSet = new HashSet<>(getExtensionsToAdd()); | ||
try { | ||
new AddExtensions(new GradleBuildFile(new FileProjectWriter(getProject().getProjectDir()))) | ||
|
@@ -45,5 +48,4 @@ public void addExtension() { | |
throw new GradleException("Failed to add extensions " + getExtensionsToAdd(), e); | ||
} | ||
} | ||
|
||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package io.quarkus.gradle.tasks; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import org.gradle.api.GradleException; | ||
|
@@ -16,13 +15,13 @@ | |
/** | ||
* @author <a href="mailto:[email protected]">Ståle Pedersen</a> | ||
*/ | ||
public class QuarkusListExtensions extends QuarkusTask { | ||
public class QuarkusListExtensions extends QuarkusPlatformTask { | ||
|
||
private boolean all = true; | ||
|
||
private String format = "concise"; | ||
|
||
private String searchPattern = null; | ||
private String searchPattern; | ||
|
||
@Optional | ||
@Input | ||
|
@@ -63,13 +62,16 @@ public QuarkusListExtensions() { | |
|
||
@TaskAction | ||
public void listExtensions() { | ||
|
||
setupPlatformDescriptor(); | ||
|
||
try { | ||
new ListExtensions(new GradleBuildFileFromConnector(new FileProjectWriter(new File(getPath())))).listExtensions( | ||
isAll(), | ||
getFormat(), getSearchPattern()); | ||
new ListExtensions(new GradleBuildFileFromConnector(new FileProjectWriter(getProject().getProjectDir()))) | ||
.listExtensions( | ||
isAll(), | ||
getFormat(), getSearchPattern()); | ||
} catch (IOException e) { | ||
throw new GradleException("Unable to list extensions", e); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.