Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configuration caching in GithubReleaseTask #42

Merged
merged 1 commit into from
Apr 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,16 @@

package com.github.breadmoirai.githubreleaseplugin

import com.github.breadmoirai.githubreleaseplugin.ast.ExtensionClass
import com.sun.org.apache.xml.internal.security.Init
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction

import java.nio.charset.StandardCharsets

@ExtensionClass
class GithubReleaseTask extends DefaultTask {

@Input
Expand Down Expand Up @@ -62,11 +57,8 @@ class GithubReleaseTask extends DefaultTask {
@Input
final Property<CharSequence> apiEndpoint

@Internal
final Project project

GithubReleaseTask() {
this.project = super.project
this.setGroup('publishing')
final ObjectFactory objectFactory = project.objects
owner = objectFactory.property(CharSequence)
Expand Down Expand Up @@ -193,7 +185,7 @@ class GithubReleaseTask extends DefaultTask {

private void uploadAssetsToUrl(GithubApi api, String url) {
for (asset in releaseAssets.files) {
log 'UPLOADING ' + project.projectDir.toPath().resolve(asset.toPath())
log 'UPLOADING ' + asset
if (asset.size() == 0) {
log "CANNOT UPLOAD ${asset.name} with file size 0"
continue
Expand Down