Coder Social home page Coder Social logo

exercise's People

Contributors

cedrickcooke avatar ebabel avatar juul-mobile-bot avatar twyatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

morristech ebabel

exercise's Issues

Build failure with Native targets while using hierarchical project structure

Attempted to add macosArm64 target to SensorTag example but am now getting the following build time failure:

* What went wrong:
Could not determine the dependencies of task ':app:compileNativeDarwinMainKotlinMetadata'.
> Could not create task ':app:kspNativeDarwinMainKotlinMetadata'.
   > class org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile_Decorated cannot be cast to class org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon (org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile_Decorated and org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @6db3646e)

Commenting out ksp(libs.exercise.compile) in app/build.gradle.kts allows the Native targets to build, but obviously breaks the Android target (because it relies on Exercise).

Support for Fragments

This would be arguments, not extras, but I don't see why the same concept can't apply.

Add support for services

The logic for creating a launch Intent can be exactly the same for Service as it is for Activity.

However, unlike an Activity, there is no getIntent function to power an extras extension property. Instead, services pass the Intent to functions as needed, such as IntentService.onHandleIntent(intent: Intent?).

Cleanest solution is probably something like this:

// Your Source
@Exercise(Extra("example", Int::class))
class MyService : IntentService() {
    init { setIntentRedelivery(true) } // Lets us ignore null intent case to simplify sample

    override fun onHandleIntent(intent: Intent) {
        Log.d("MyService", "Example extra: ${extras(intent).example}")
    }
}

// Generated
class MyServiceParams(
    private val intent: Intent
) {
    val example: Int
        get() = intent.extras.get("${intent.component.packageName}.example") as Int
}

fun MyService.extras(intent: Intent): MyServiceParams
    get() = MyServiceParams(intent)

We don't get the parameter as a val extension, but this is probably the best we can do.

Issue Snapshots from Master

A lot of our feature prioritization is done so we can eat our own dog food. Would be nice if we didn't have to issue a release for every feature, so we could make them more meaningful.

`core-ktx` dependency is needed in generated code

When someone is using Exercise, it will generate code that uses bundleOf (androidx.core.os.bundleOf).

When setting up Exercise, library consumers will commonly use the following Gradle configuration:

implementation("com.juul.exercise:annotations:$version")
ksp("com.juul.exercise:compile:$version")

Unfortunately, the generated code will not compile if the core-ktx dependency is not manually pulled in, as annotations module does not define core-ktx as api (nor should it do so).

Not sure the best approach to getting core-ktx pulled in, aside from either instructing that consumers pull in core-ktx manually or pull in an Exercise module that has core-ktx as api.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/actions v3
  • EnricoMi/publish-unit-test-result-action v2
  • codecov/codecov-action v4
  • ubuntu 22.04
.github/workflows/dokka.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/actions v3
  • JamesIves/github-pages-deploy-action v4
  • ubuntu 22.04
.github/workflows/publish.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/actions v3
  • ubuntu 22.04
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v6
.github/workflows/version-labels.yml
  • mheap/github-action-required-labels v5
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
annotations/gradle.properties
annotations/build.gradle.kts
compile/gradle.properties
compile/build.gradle.kts
gradle/jacoco.gradle.kts
gradle/libs.versions.toml
  • org.assertj:assertj-core 3.26.3
  • com.juul.khronicle:khronicle-core 0.3.0
  • org.jetbrains.kotlin:kotlin-parcelize-runtime 2.0.0
  • com.squareup:kotlinpoet 1.18.0
  • com.google.devtools.ksp:symbol-processing-api 2.0.0-1.0.23
  • com.github.tschuchortdev:kotlin-compile-testing-ksp 1.6.0
  • org.robolectric:robolectric 4.13
  • com.android.application 8.5.1
  • com.android.library 8.5.1
  • org.jetbrains.kotlinx.binary-compatibility-validator 0.15.1
  • org.jetbrains.dokka 1.9.20
  • org.jetbrains.kotlin.jvm 2.0.0
  • org.jmailen.kotlinter 4.4.0
  • com.vanniktech.maven.publish 0.29.0
runtime/gradle.properties
runtime/build.gradle.kts
stubs/gradle.properties
stubs/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.