-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
132 changed files
with
1,737 additions
and
425 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
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
39 changes: 39 additions & 0 deletions
39
buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy
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,39 @@ | ||
package org.jetbrains | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.ModuleVersionIdentifier | ||
import org.gradle.api.artifacts.ProjectDependency | ||
import org.gradle.api.artifacts.SelfResolvingDependency | ||
import org.gradle.api.publish.internal.ProjectDependencyPublicationResolver | ||
import org.gradle.api.publish.maven.MavenPom | ||
import org.gradle.api.publish.maven.MavenPublication | ||
|
||
static void configure(MavenPublication publication, Project project) { | ||
publication.artifact(project.tasks.shadowJar) | ||
|
||
publication.pom { MavenPom pom -> | ||
pom.withXml { xml -> | ||
def dependenciesNode = xml.asNode().appendNode('dependencies') | ||
|
||
project.configurations.shadow.allDependencies.each { | ||
//if (! (it instanceof SelfResolvingDependency)) { | ||
if (it instanceof ProjectDependency) { | ||
def projectDependencyResolver = project.gradle.services.get(ProjectDependencyPublicationResolver) | ||
ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(it) | ||
addDependency(dependenciesNode, identifier) | ||
} else if (!(it instanceof SelfResolvingDependency)) { | ||
addDependency(dependenciesNode, it) | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
||
private static void addDependency(Node dependenciesNode, dep) { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', dep.group) | ||
dependencyNode.appendNode('artifactId', dep.name) | ||
dependencyNode.appendNode('version', dep.version) | ||
dependencyNode.appendNode('scope', 'runtime') | ||
} |
14 changes: 14 additions & 0 deletions
14
buildSrc/src/main/groovy/org/jetbrains/DependenciesVersionGetter.groovy
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,14 @@ | ||
package org.jetbrains | ||
|
||
import org.gradle.api.Project | ||
|
||
class DependenciesVersionGetter { | ||
static Properties getVersions(Project project, String artifactVersionSelector) { | ||
def dep = project.dependencies.create(group: 'teamcity', name: 'dependencies', version: artifactVersionSelector, ext: 'properties') | ||
def file = project.configurations.detachedConfiguration(dep).resolve().first() | ||
|
||
def prop = new Properties() | ||
prop.load(new FileReader(file)) | ||
return prop | ||
} | ||
} |
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
Oops, something went wrong.