Skip to content

Commit

Permalink
Revert "assets can also have custom configuration.yml locations" (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinychen authored Jul 9, 2024
1 parent c59cd74 commit 6f344dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package com.palantir.gradle.dist.asset;

import com.palantir.gradle.dist.DeploymentDirInclusion;
import com.palantir.gradle.dist.ProductDependencyIntrospectionPlugin;
import com.palantir.gradle.dist.SlsBaseDistPlugin;
import com.palantir.gradle.dist.service.JavaServiceDistributionPlugin;
import com.palantir.gradle.dist.tasks.ConfigTarTask;
import com.palantir.gradle.dist.tasks.CreateManifestTask;
import java.io.File;
import org.gradle.api.InvalidUserCodeException;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
Expand Down Expand Up @@ -81,10 +81,13 @@ public void apply(Project project) {
String archiveRootDir = String.format(
"%s-%s", distributionExtension.getDistributionServiceName().get(), p.getVersion());

task.into(archiveRootDir, root -> {
DeploymentDirInclusion.includeFromDeploymentDirs(
project.getLayout(), distributionExtension, root, _ignored -> {});
});
task.from(
new File(project.getProjectDir(), "deployment"),
t -> t.into(new File(String.format("%s/deployment", archiveRootDir))));

task.from(
new File(project.getBuildDir(), "deployment"),
t -> t.into(new File(String.format("%s/deployment", archiveRootDir))));

distributionExtension
.getAssets()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,34 +137,6 @@ class AssetDistributionPluginIntegrationSpec extends GradleIntegrationSpec {
dep2['maximum-version'] == '2.x.x'
}

def 'allows another task to produce configuration.yml'() {
given:
createUntarBuildFile(buildFile)
debug = true

// language=Gradle
buildFile << '''
task createConfigurationYml {
outputs.file('build/some-place/configuration.yml')
doFirst {
file('build/some-place/configuration.yml').text = 'custom: yml'
}
}
distribution {
configurationYml.fileProvider(tasks.named('createConfigurationYml').map { it.outputs.files.singleFile })
}
'''.stripIndent(true)

when:
runTasks(':distTar', ':untar')

then:
String actualConfiguration = new File(projectDir, 'dist/asset-name-0.0.1/deployment/configuration.yml').text
actualConfiguration == 'custom: yml'
}

/**
* Note: in this test, we are not checking that we can resolve exactly the right artifact,
* as that is tricky to get right, when the configuration being resolved doesn't set any required attributes.
Expand Down

0 comments on commit 6f344dc

Please sign in to comment.