@@ -23,15 +23,11 @@ import org.gradle.api.artifacts.ModuleDependency
2323import org.gradle.api.artifacts.ProjectDependency
2424import org.gradle.api.file.DeleteSpec
2525import org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency
26- import org.gradle.api.publish.maven.MavenPublication
2726import org.gradle.api.tasks.Delete
2827import org.labkey.gradle.plugin.extension.DistributionExtension
29- import org.labkey.gradle.plugin.extension.LabKeyExtension
3028import org.labkey.gradle.plugin.extension.TeamCityExtension
31- import org.labkey.gradle.task.ModuleDistribution
3229import org.labkey.gradle.util.BuildUtils
3330import org.labkey.gradle.util.GroupNames
34- import org.labkey.gradle.util.PomFileHelper
3531import org.labkey.gradle.util.TaskUtils
3632
3733class Distribution implements Plugin<Project >
@@ -62,10 +58,6 @@ class Distribution implements Plugin<Project>
6258 addDependencies(project)
6359 addTasks(project)
6460 addTaskDependencies(project)
65-
66- // commented out until we start publishing distribution artifacts, and then we'll examine the publications more closely
67- // if (BuildUtils.shouldPublishDistribution(project))
68- // addArtifacts(project)
6961 }
7062
7163 private void addConfigurations (Project project )
@@ -169,74 +161,6 @@ class Distribution implements Plugin<Project>
169161 project. dependencies. add(" distribution" , dep)
170162 }
171163 }
172-
173- private void addArtifacts (Project project )
174- {
175- project. apply plugin : ' maven-publish'
176-
177- // TODO this is really only an approximation of what's needed. We don't currently publish distribution artifacts
178- // to artifactory
179- project. afterEvaluate {
180- String artifactId = getArtifactId(project)
181- Properties pomProperties = LabKeyExtension . getApiPomProperties(artifactId, project. dist. description, project)
182- project. publishing {
183- publications {
184- distributions(MavenPublication ) { pub ->
185- pub. artifactId(artifactId)
186- project. tasks. each {
187- if (it instanceof ModuleDistribution )
188- {
189- it. outputs. files. each {File file ->
190- pub. artifact(file)
191- {
192- String fileName = file. getName()
193- if (fileName. endsWith(" gz" ))
194- extension " tar.gz"
195- if (fileName. contains(" -src." ))
196- classifier " src"
197- }
198- }
199- }
200- }
201- pom {
202- name = project. name
203- description = pomProperties. getProperty(" Description" )
204- url = PomFileHelper . LABKEY_ORG_URL
205- developers PomFileHelper . getLabKeyTeamDevelopers()
206- // TODO this should probably not always be Apache license
207- // licenses pomUtil.getLicense()
208- organization PomFileHelper . getLabKeyOrganization()
209- // scm PomFileHelper.getLabKeyScm()
210- // doesn't seem like these pom files will have any dependencies
211- }
212- }
213- }
214-
215- project. artifactoryPublish {
216- project. tasks. each {
217- if (it instanceof ModuleDistribution )
218- {
219- dependsOn it
220- }
221- }
222- publications(' distributions' )
223- }
224- }
225- }
226- }
227-
228- static String getArtifactId (Project project )
229- {
230- if (project. dist. artifactId != null )
231- return project. dist. artifactId
232- else
233- {
234- return TaskUtils . getOptionalTask(project, " distribution" )
235- .filter(task -> task. get() instanceof ModuleDistribution )
236- .map(task -> ((ModuleDistribution )task. get()). getArtifactId())
237- .orElse(project. name)
238- }
239- }
240164}
241165
242166
0 commit comments