PocketByte / LocoLaser

Localization tool to import localized strings from external source to your project.
Apache License 2.0
31 stars 1 forks source link

2.2.1 LocalizeTask input/output annotation #21

Closed gswierczynski closed 2 months ago

gswierczynski commented 3 years ago

Hi,

I am trying to use version 2.2.1 of gradle plugin with kmm project.

  1. My dependencies:
        classpath "ru.pocketbyte.locolaser:plugin:2.2.1"
        classpath "ru.pocketbyte.locolaser:core:2.2.1"
        classpath "ru.pocketbyte.locolaser:resource-kotlin-mpp:2.2.1"
        classpath "ru.pocketbyte.locolaser:resource-mobile:2.2.1"
  2. Plugin applied
  3. Config A ./localize_config.json
    {
    "platform": [
    {
      "type": "kotlin-common",
      "res_dir": "./build/generated/locolaser/common/"
    },
    {
      "type": "kotlin-android",
      "res_dir": "./build/generated/locolaser/android/"
    },
    {
      "type": "kotlin-ios",
      "res_dir": "./build/generated/locolaser/ios/"
    }
    ],
    "source": [
    {
      "type": "android",
      "res_dir": "../app/src/main/res/"
    }
    ],
    "locales" : ["base"],
    "temp_dir": "./build/temp/"
    }
    localize {
        configFromFile("JsonConfig", "./localize_config.json")
    }
  1. Config B
    localize {
        config {
            platform {
                kotlinMultiplatform {
                    srcDir = File("./build/res/kmpp/")
                    repositoryInterface = "com.example.SuperString"
                    repositoryClass = "com.example.SuperStringImpl"
                    android(); ios()
                }
                kotlinCommon {
                    resourcesDir("./build/generated/locolaser/common/")
                }
                android {
                    resourcesDir("./build/generated/locolaser/android/")
                }
                ios {
                    resourcesDir("./build/generated/locolaser/ios/")
                }
            }
            source.android {
                resourcesDir("../app/src/main/res/")
            }
            locales = setOf("base")
            tempDir("./build/temp/")
        }
    }

When trying to run: ./gradlew :kmm:localize I am getting:

  - Type 'ru.pocketbyte.locolaser.plugin.LocalizeTask' property 'config' is missing an input or output annotation.

    Reason: A property without annotation isn't considered during up-to-date checking.

    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.

Not sure if this is an issue with library or user (mine) error.

KamiSempai commented 3 years ago

Sorry, I forgot to mention it in documentation. Currently the second way (Config B) is working only in Kotlin Gradle DSL (.kts files). Groovy support is not yet implemented.

gswierczynski commented 3 years ago

Hey @KamiSempai Thanks for replying.

I used the Config B inside Kotlin Gradle file (although I do have Groovy ones in other modules).

Config A is raising the same error message.

At the moment I reverted to 1.0.4 plugin version with configuration in json file.

gswierczynski commented 2 months ago

Closing. The version 2.4.2 works like a charm with configuration defined in gradle.build.kts.