[gradle-debian-helper] 07/08: MavenPom.java: Indent = 4 spaces
Kai-Chung Yan
seamlik-guest at moszumanska.debian.org
Sat Oct 22 11:42:43 UTC 2016
This is an automated email from the git hooks/post-receive script.
seamlik-guest pushed a commit to branch master
in repository gradle-debian-helper.
commit f14925c68becf9ec38c4cd424b9ca1f06ef9edee
Author: Kai-Chung Yan (殷啟聰) <seamlikok at gmail.com>
Date: Fri Oct 21 17:57:02 2016 +0800
MavenPom.java: Indent = 4 spaces
---
.../java/org/debian/gradle/tasks/MavenPom.java | 176 ++++++++++-----------
1 file changed, 88 insertions(+), 88 deletions(-)
diff --git a/gradle-helper-plugin/src/main/java/org/debian/gradle/tasks/MavenPom.java b/gradle-helper-plugin/src/main/java/org/debian/gradle/tasks/MavenPom.java
index b5439b5..234c90c 100644
--- a/gradle-helper-plugin/src/main/java/org/debian/gradle/tasks/MavenPom.java
+++ b/gradle-helper-plugin/src/main/java/org/debian/gradle/tasks/MavenPom.java
@@ -33,107 +33,107 @@ import java.util.Comparator;
@ParallelizableTask
public class MavenPom extends DefaultTask {
- /* Since the Groovy in Gradle scripts are dynamically typed and due to
- Gradle's own class loading mechanism, we couldn't cast the type of
- org.apache.maven.model.Dependency. So we have to use Reflections. */
- private String getMavenDependencyScope(Object dependency) {
- String result = null;
- try {
- result = ((String)dependency.getClass()
- .getMethod("getScope")
- .invoke(dependency));
- } finally {
- return result;
+ /* Since the Groovy in Gradle scripts are dynamically typed and due to
+ Gradle's own class loading mechanism, we couldn't cast the type of
+ org.apache.maven.model.Dependency. So we have to use Reflections. */
+ private String getMavenDependencyScope(Object dependency) {
+ String result = null;
+ try {
+ result = ((String)dependency.getClass()
+ .getMethod("getScope")
+ .invoke(dependency));
+ } finally {
+ return result;
+ }
}
- }
- private String getMavenDependencyGroupId(Object dependency) {
- String result = null;
- try {
- result = ((String)dependency.getClass()
- .getMethod("getGroupId")
- .invoke(dependency));
- } finally {
- return result;
+ private String getMavenDependencyGroupId(Object dependency) {
+ String result = null;
+ try {
+ result = ((String)dependency.getClass()
+ .getMethod("getGroupId")
+ .invoke(dependency));
+ } finally {
+ return result;
+ }
}
- }
- private String getMavenDependencyArtifactId(Object dependency) {
- String result = null;
- try {
- result = ((String)dependency.getClass()
- .getMethod("getArtifactId")
- .invoke(dependency));
- } finally {
- return result;
+ private String getMavenDependencyArtifactId(Object dependency) {
+ String result = null;
+ try {
+ result = ((String)dependency.getClass()
+ .getMethod("getArtifactId")
+ .invoke(dependency));
+ } finally {
+ return result;
+ }
}
- }
- private String getMavenDependencyVersion(Object dependency) {
- String result = null;
- try {
- result = ((String)dependency.getClass()
- .getMethod("getVersion")
- .invoke(dependency));
- } finally {
- return result;
+ private String getMavenDependencyVersion(Object dependency) {
+ String result = null;
+ try {
+ result = ((String)dependency.getClass()
+ .getMethod("getVersion")
+ .invoke(dependency));
+ } finally {
+ return result;
+ }
}
- }
- private void sortPomDependencies(org.gradle.api.artifacts.maven.MavenPom pom) {
- Collections.sort(
- pom.getDependencies(),
- new Comparator<Object>() {
- @Override
- public int compare(Object o1, Object o2) {
- if (getMavenDependencyScope(o1).compareTo(getMavenDependencyScope(o2)) != 0) {
- return getMavenDependencyScope(o1).compareTo(getMavenDependencyScope(o2));
- } else if (getMavenDependencyGroupId(o1).compareTo(getMavenDependencyGroupId(o2)) != 0) {
- return getMavenDependencyGroupId(o1).compareTo(getMavenDependencyGroupId(o2));
- } else if (getMavenDependencyArtifactId(o1).compareTo(getMavenDependencyArtifactId(o2)) != 0) {
- return getMavenDependencyArtifactId(o1).compareTo(getMavenDependencyArtifactId(o2));
- } else {
- return getMavenDependencyVersion(o1).compareTo(getMavenDependencyVersion(o2));
+ private void sortPomDependencies(org.gradle.api.artifacts.maven.MavenPom pom) {
+ Collections.sort(
+ pom.getDependencies(),
+ new Comparator<Object>() {
+ @Override
+ public int compare(Object o1, Object o2) {
+ if (getMavenDependencyScope(o1).compareTo(getMavenDependencyScope(o2)) != 0) {
+ return getMavenDependencyScope(o1).compareTo(getMavenDependencyScope(o2));
+ } else if (getMavenDependencyGroupId(o1).compareTo(getMavenDependencyGroupId(o2)) != 0) {
+ return getMavenDependencyGroupId(o1).compareTo(getMavenDependencyGroupId(o2));
+ } else if (getMavenDependencyArtifactId(o1).compareTo(getMavenDependencyArtifactId(o2)) != 0) {
+ return getMavenDependencyArtifactId(o1).compareTo(getMavenDependencyArtifactId(o2));
+ } else {
+ return getMavenDependencyVersion(o1).compareTo(getMavenDependencyVersion(o2));
+ }
+ }
+ @Override
+ public boolean equals(Object obj) { return false; }
}
- }
-
- @Override
- public boolean equals(Object obj) { return false; }
- }
- );
- }
+ );
+ }
- @OutputDirectory
- private File getDestinationPomDir() {
- return new File(getProject().getBuildDir(), "debian");
- }
+ @OutputDirectory
+ private File getDestinationPomDir() {
+ return new File(getProject().getBuildDir(), "debian");
+ }
- @OutputFile
- private File getDestinationPomFile() {
- return new File(
- getDestinationPomDir(),
- getProject().getConvention()
- .getPlugin(BasePluginConvention.class)
- .getArchivesBaseName() + ".pom"
- );
- }
+ @OutputFile
+ private File getDestinationPomFile() {
+ return new File(
+ getDestinationPomDir(),
+ getProject().getConvention()
+ .getPlugin(BasePluginConvention.class)
+ .getArchivesBaseName() + ".pom"
+ );
+ }
- @TaskAction
- private void generatePom() {
- final org.gradle.api.artifacts.maven.MavenPom pom =
+ @TaskAction
+ private void generatePom() {
+ final org.gradle.api.artifacts.maven.MavenPom pom =
getProject().getConvention()
.getPlugin(MavenPluginConvention.class)
.pom();
- pom.project(new MethodClosure(
- new Object() { public void execute() {} },
- "execute"
- ));
- pom.setArtifactId(getProject().getConvention()
- .getPlugin(BasePluginConvention.class)
- .getArchivesBaseName());
- final org.gradle.api.artifacts.maven.MavenPom effectivePom = pom.getEffectivePom();
- sortPomDependencies(effectivePom);
- getDestinationPomDir().mkdir();
- effectivePom.writeTo(getDestinationPomFile());
- }
+ pom.project(new MethodClosure(
+ new Object() { public void execute() {} },
+ "execute"
+ ));
+ pom.setArtifactId(getProject().getConvention()
+ .getPlugin(BasePluginConvention.class)
+ .getArchivesBaseName());
+ final org.gradle.api.artifacts.maven.MavenPom effectivePom =
+ pom.getEffectivePom();
+ sortPomDependencies(effectivePom);
+ getDestinationPomDir().mkdir();
+ effectivePom.writeTo(getDestinationPomFile());
+ }
}
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/gradle-debian-helper.git
More information about the pkg-java-commits
mailing list