Skip to content

Commit

Permalink
More cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski committed Nov 10, 2023
1 parent 231e77c commit 16deb6e
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 39 deletions.
18 changes: 9 additions & 9 deletions licensee-for-android/api/licensee-for-android.api
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
public abstract class se/premex/gross/AssetCopyTask : org/gradle/api/DefaultTask {
public abstract class io/github/usefulness/licensee/AssetCopyTask : org/gradle/api/DefaultTask {
public fun <init> ()V
public final fun action ()V
public abstract fun getInputFile ()Lorg/gradle/api/file/RegularFileProperty;
public abstract fun getOutputDirectory ()Lorg/gradle/api/file/DirectoryProperty;
public abstract fun getTargetFileName ()Lorg/gradle/api/provider/Property;
}

public abstract class se/premex/gross/CodeGenerationTask : org/gradle/api/DefaultTask {
public abstract class io/github/usefulness/licensee/CodeGenerationTask : org/gradle/api/DefaultTask {
public fun <init> ()V
public final fun action ()V
public abstract fun getInputFile ()Lorg/gradle/api/file/RegularFileProperty;
public abstract fun getOutputDirectory ()Lorg/gradle/api/file/DirectoryProperty;
}

public final class se/premex/gross/GrossPlugin : org/gradle/api/Plugin {
public fun <init> ()V
public synthetic fun apply (Ljava/lang/Object;)V
public fun apply (Lorg/gradle/api/Project;)V
}

public class se/premex/gross/LicenseeForAndroidExtension {
public class io/github/usefulness/licensee/LicenseeForAndroidExtension {
public fun <init> (Lorg/gradle/api/model/ObjectFactory;)V
public final fun getAndroidAssetFileName ()Lorg/gradle/api/provider/Property;
public final fun getEnableAndroidAssetGeneration ()Lorg/gradle/api/provider/Property;
public final fun getEnableKotlinCodeGeneration ()Lorg/gradle/api/provider/Property;
public final fun getSingularVariantName ()Lorg/gradle/api/provider/Property;
}

public final class io/github/usefulness/licensee/LicenseeForAndroidPlugin : org/gradle/api/Plugin {
public fun <init> ()V
public synthetic fun apply (Ljava/lang/Object;)V
public fun apply (Lorg/gradle/api/Project;)V
}

9 changes: 4 additions & 5 deletions licensee-for-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ dependencies {
implementation(libs.com.squareup.kotlinpoet) {
exclude(module: "kotlin-reflect")
}

implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlinx.serialization.json.okio)
implementation(libs.com.squareup.okio)

testRuntimeOnly(libs.junit.jupiter.engine)

testImplementation(libs.junit.jupiter.api)
testImplementation(libs.assertj.core)
}
Expand All @@ -29,7 +29,6 @@ kotlin {
explicitApi()
}


tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
apiVersion = "1.8"
Expand All @@ -46,10 +45,10 @@ gradlePlugin {
plugins {
create("gross") {
id = "io.github.usefulness.licensee-for-android"
displayName = "ktlint Gradle plugin"
displayName = "`cashapp/licensee` helper for Android"
description = project.description
tags.addAll(["tooling", "open source", "premex"])
implementationClass = "se.premex.gross.GrossPlugin"
tags.addAll(["licensee", "android", "kotlin", "assets", "resources"])
implementationClass = "io.github.usefulness.licensee.LicenseeForAndroidPlugin"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.premex.gross
package io.github.usefulness.licensee

import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.CodeBlock
import com.squareup.kotlinpoet.MemberName
import com.squareup.kotlinpoet.TypeSpec
import se.premex.gross.core.Artifact
import io.github.usefulness.licensee.core.Artifact

internal class ArtifactCodeGenerator(
private val packageName: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package se.premex.gross
package io.github.usefulness.licensee

import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package se.premex.gross
package io.github.usefulness.licensee

import com.squareup.kotlinpoet.CodeBlock
import com.squareup.kotlinpoet.FileSpec
import com.squareup.kotlinpoet.MemberName
import com.squareup.kotlinpoet.PropertySpec
import com.squareup.kotlinpoet.TypeSpec
import io.github.usefulness.licensee.core.Artifact
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.okio.decodeFromBufferedSource
Expand All @@ -19,7 +20,6 @@ import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
import se.premex.gross.core.Artifact

@CacheableTask
public abstract class CodeGenerationTask : DefaultTask() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package se.premex.gross
package io.github.usefulness.licensee

import org.gradle.api.Incubating
import org.gradle.api.model.ObjectFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package se.premex.gross
package io.github.usefulness.licensee

import com.android.build.api.variant.AndroidComponentsExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.reporting.ReportingExtension

public class GrossPlugin : Plugin<Project> {
public class LicenseeForAndroidPlugin : Plugin<Project> {

override fun apply(project: Project): Unit = with(project) {
val extension = extensions.create("licenseeForAndroid", LicenseeForAndroidExtension::class.java)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package se.premex.gross
package io.github.usefulness.licensee

import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.FunSpec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package se.premex.gross.core
package io.github.usefulness.licensee.core

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package se.premex.gross
package io.github.usefulness.licensee

import io.github.usefulness.licensee.core.Artifact
import io.github.usefulness.licensee.core.Scm
import io.github.usefulness.licensee.core.SpdxLicenses
import io.github.usefulness.licensee.core.UnknownLicenses
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import se.premex.gross.core.Artifact
import se.premex.gross.core.Scm
import se.premex.gross.core.SpdxLicenses
import se.premex.gross.core.UnknownLicenses

class ArtifactGeneratorTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package se.premex.gross
package io.github.usefulness.licensee

import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
Expand Down
6 changes: 1 addition & 5 deletions sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ licensee {
licenseeForAndroid {
enableKotlinCodeGeneration = true
enableAndroidAssetGeneration = true
singularVariantName = "release"
}
android {
namespace "io.githhub.usefulness.licensee.android.app"
Expand Down Expand Up @@ -57,11 +58,6 @@ dependencies {

implementation(project(":ui"))

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.ui.test.junit4)
debugImplementation(libs.ui.tooling)
debugImplementation(libs.ui.test.manifest)
}
4 changes: 0 additions & 4 deletions sample/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ activity-compose = "1.8.0"
androidx-compose-compiler = "1.5.4"
androidx-core = "1.12.0"
androidx-test-ext-junit = "1.1.5"
com-android-application = "8.1.3"
com-squareup-moshi = "1.15.0"
compose-bom = "2023.10.01"
core-ktx = "1.12.0"
espresso-core = "3.5.1"
junit = "4.13.2"
lifecycle-runtime-ktx = "2.6.2"

[libraries]
Expand All @@ -30,7 +28,6 @@ activity-compose = { module = "androidx.activity:activity-compose", version.ref
org-jetbrains-kotlin-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "maven-kotlin" }
androidx-lifecycle-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle-runtime-ktx" }
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" }
com-android-tools-build-gradle = { module = "com.android.tools.build:gradle", version.ref = "com-android-application" }
com-squareup-moshi = { module = "com.squareup.moshi:moshi", version.ref = "com-squareup-moshi" }
com-squareup-moshi-moshi-kotlin-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "com-squareup-moshi" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
Expand All @@ -47,7 +44,6 @@ androidx-compose-ui-ui-text = { module = "androidx.compose.ui:ui-text" }
androidx-core-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" }
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso-core" }
junit = { module = "junit:junit", version.ref = "junit" }
org-jetbrains-kotlinx-kotlinx-coroutines-test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3"
lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
material3 = { module = "androidx.compose.material3:material3" }
Expand Down

0 comments on commit 16deb6e

Please sign in to comment.