Skip to content

Commit

Permalink
Fix missing annotations to support Gradle 7
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsk committed Aug 29, 2021
1 parent b939afd commit 1cf4f52
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.gradle.api.Named
import org.gradle.api.reflect.HasPublicType
import org.gradle.api.reflect.TypeOf
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.kotlin.dsl.typeOf

interface AssemblyOptions : Named {
Expand Down Expand Up @@ -67,11 +68,15 @@ interface AssemblyOptions : Named {
*/
@get:Input
var targetConfigurations: Set<String>

@Input
override fun getName(): String
}

class AssemblyOptionsImpl(private val name: String) : AssemblyOptions, HasPublicType {
override fun getName(): String = name

@Internal
override fun getPublicType(): TypeOf<AssemblyOptions> {
return typeOf()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import org.gradle.api.Action
import org.gradle.api.Named
import org.gradle.api.reflect.HasPublicType
import org.gradle.api.reflect.TypeOf
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Nested
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.kotlin.dsl.typeOf
Expand All @@ -20,20 +21,25 @@ interface VariantAwareOptions : Named {
* @see baseDir
*/
@Deprecated("the name has been changed. This would be removed in 1.0.0", replaceWith = ReplaceWith("baseDir"))
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:InputDirectory
@get:Optional
var artifactDefinitionDirectory: File?

/**
* @see baseDir
*/
@Deprecated("this name was produced by a typo. This will be removed in 1.0.0.", replaceWith = ReplaceWith("baseDir"))
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:InputDirectory
@get:Optional
var dataDir: File?

/**
* A parent directory of an artifact definition file.
*/
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:InputDirectory
@get:OutputDirectory
@get:Optional
var baseDir: File?

Expand All @@ -46,6 +52,9 @@ interface VariantAwareOptions : Named {
fun assembly(action: Action<AssemblyOptions>)

fun visualization(action: Action<VisualizationOptions>)

@Input
override fun getName(): String
}

class VariantAwareOptionsImpl(
Expand All @@ -72,6 +81,7 @@ class VariantAwareOptionsImpl(
action.execute(visualization)
}

@Internal
override fun getPublicType(): TypeOf<VariantAwareOptions> {
return typeOf()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.gradle.api.reflect.HasPublicType
import org.gradle.api.reflect.TypeOf
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.PathSensitive
Expand Down Expand Up @@ -48,15 +49,19 @@ interface VisualizationOptions : Named {
/**
* An output directory of the generated visualized file.
*/
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:OutputDirectory
@get:Optional
var outputDir: File?

@Input
override fun getName(): String
}

class VisualizationOptionsImpl(
private val name: String
) : VisualizationOptions, HasPublicType {

@Internal
override fun getPublicType(): TypeOf<VisualizationOptions> {
return typeOf()
}
Expand Down

0 comments on commit 1cf4f52

Please sign in to comment.