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

Mark StoneTask as cacheable and resolve some dbapp integration issues #515

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id "org.jetbrains.kotlinx.binary-compatibility-validator"
alias(dropboxJavaSdkLibs.plugins.maven.publish.plugin)
alias(dropboxJavaSdkLibs.plugins.gradle.version.plugin)
alias(dropboxJavaSdkLibs.plugins.dependency.guard)
Comment on lines -5 to -7
Copy link
Contributor Author

@wdziemia wdziemia Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dbapp already has these on classpath so alias fails because each include a version and plugin block cannot handle this.

id "com.vanniktech.maven.publish"
id "com.github.ben-manes.versions"
id "com.dropbox.dependency-guard"
}

android {
namespace = "com.dropbox.core.sdk.android"
compileSdk dropboxJavaSdkLibs.versions.android.compile.sdk.get().toInteger()
defaultConfig {
minSdk dropboxJavaSdkLibs.versions.android.min.sdk.get().toInteger()
Expand Down
7 changes: 6 additions & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ ext {
}

tasks.register('versionWriterTask') {
def versionName = project.property("VERSION_NAME")
String versionName
if (project.hasProperty("VERSION_NAME")) {
versionName = "${project.property("VERSION_NAME")}"
} else {
versionName = project.version
}
Comment on lines +31 to +36
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project will use VERSION_NAME during publish, dbapp has no visibility on gradle.properties as it has its own. We use project.version as a fallback and set it within dbapp.

it.inputs.property("versionName", versionName)

def generatedDir = project.layout.buildDirectory.dir("generated/version")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.*
import org.gradle.process.ExecOperations
import java.io.File
import java.io.FileOutputStream
import javax.inject.Inject

@CacheableTask
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With help of @devPalacio - marks this Task as cacheable which should increase build speeds

abstract class StoneTask : DefaultTask() {

@get:Inject
Expand All @@ -26,16 +22,20 @@ abstract class StoneTask : DefaultTask() {
abstract val stoneConfigs: ListProperty<StoneConfig>

@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
abstract val generatorDir: DirectoryProperty

@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
abstract val specDir: DirectoryProperty

@get:Optional
@get:InputFile
@get:PathSensitive(PathSensitivity.RELATIVE)
abstract val routeWhitelistFilter: RegularFileProperty

@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
abstract val stoneDir: DirectoryProperty

@get:Input
Expand Down