Skip to content

Commit

Permalink
remove accidental connection between task outputs (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
esword authored Oct 4, 2024
1 parent 4aea5f2 commit 20a492c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-1709.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: remove accidental connection between task outputs
links:
- https://github.com/palantir/sls-packaging/pull/1709
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class ProductDependencies {

public static TaskProvider<ResolveProductDependenciesTask> registerProductDependencyTasks(
Project project, BaseDistributionExtension ext) {
Provider<Directory> pdepsDir = project.getLayout().getBuildDirectory().dir("product-dependencies");
Provider<Directory> pdepsDir = project.getLayout().getBuildDirectory().dir("resolved-pdeps");

// Register compatibility rule to ensure that ResourceTransform is applied onto project dependencies so we
// avoid compilation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package com.palantir.gradle.dist.pdeps

import com.palantir.gradle.dist.BaseDistributionExtension
import com.palantir.gradle.dist.ObjectMappers
import spock.lang.Unroll

import java.nio.file.Files
import java.nio.file.StandardCopyOption
import nebula.test.IntegrationSpec
Expand Down Expand Up @@ -60,7 +62,7 @@ class ResolveProductDependenciesIntegrationSpec extends IntegrationSpec {

then:
def manifest = ObjectMappers.readProductDependencyManifest(
file('build/product-dependencies/pdeps-manifest.json'))
file('build/resolved-pdeps/pdeps-manifest.json'))
!manifest.productDependencies().isEmpty()
}

Expand All @@ -86,7 +88,7 @@ class ResolveProductDependenciesIntegrationSpec extends IntegrationSpec {
then:
!result.wasExecuted(':child:jar')
def manifest = ObjectMappers.readProductDependencyManifest(
file('build/product-dependencies/pdeps-manifest.json'))
file('build/resolved-pdeps/pdeps-manifest.json'))
!manifest.productDependencies().isEmpty()
}

Expand Down Expand Up @@ -117,7 +119,7 @@ class ResolveProductDependenciesIntegrationSpec extends IntegrationSpec {

then:
def manifest = ObjectMappers.readProductDependencyManifest(
file('build/product-dependencies/pdeps-manifest.json'))
file('build/resolved-pdeps/pdeps-manifest.json'))
!manifest.productDependencies().isEmpty()
}

Expand Down Expand Up @@ -148,7 +150,23 @@ class ResolveProductDependenciesIntegrationSpec extends IntegrationSpec {

then:
def manifest = ObjectMappers.readProductDependencyManifest(
file('build/product-dependencies/pdeps-manifest.json'))
file('build/resolved-pdeps/pdeps-manifest.json'))
manifest.productDependencies().isEmpty()
}

def 'resolveProductDependencies and processResources work together'() {
// this is a strange setup that really shouldn't happen in a real repo - a project shouldn't be both an API
// jar and a distribution. But in case it does happen we want to make sure there are no accidental
// connections between the tasks.
when:
//language=gradle
buildFile.text = '''
apply plugin: 'java'
apply plugin: 'com.palantir.recommended-product-dependencies'
apply plugin: 'com.palantir.sls-asset-distribution'
'''.stripIndent()

then:
runTasksSuccessfully('resolveProductDependencies', 'processResources')
}
}

0 comments on commit 20a492c

Please sign in to comment.