Closed cooperkong closed 6 years ago
If I add
sourceSets {
main.java.srcDirs += 'build/generated/source/navigator/debug'
}
it compiles and cycle navigation works fine. M1->M2, M2->M1, but this is not something I want to add to gradle.
I think my activity is in Kotlin, thus it can't be resolved. Change it to java class works fine.
Thank you very much for the detail. We actually don't use Kotlin yet.
Not sure how to address this issue, it seems to me that the generated code folder should have been added. Kotlin or Java should not matter.
I keep the issue open to double check that the folder is added explicitly by the gradle plugin of DH3.
2018-05-31 17:42 GMT-07:00 WenChao Kong notifications@github.com:
I think my activity is in Kotlin, thus it can't be resolved. Change it to java class works fine.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/f2prateek/dart/issues/217#issuecomment-393725044, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33Z1uq5feI8lBu9YahAn_VaxOmn-Kks5t4I4OgaJpZM4UV6eI .
And your work around is actually good, the plugin should be doing it for you.
Note to self: Oh, maybe we added the path to the java compile task, but the kotlin task should use it too. There must be a better way to do it (regiserGeneratedFolder maybe ? )
2018-05-31 20:34 GMT-07:00 Stéphane NICOLAS steff.nicolas@gmail.com:
Thank you very much for the detail. We actually don't use Kotlin yet.
Not sure how to address this issue, it seems to me that the generated code folder should have been added. Kotlin or Java should not matter.
I keep the issue open to double check that the folder is added explicitly by the gradle plugin of DH3.
2018-05-31 17:42 GMT-07:00 WenChao Kong notifications@github.com:
I think my activity is in Kotlin, thus it can't be resolved. Change it to java class works fine.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/f2prateek/dart/issues/217#issuecomment-393725044, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33Z1uq5feI8lBu9YahAn_VaxOmn-Kks5t4I4OgaJpZM4UV6eI .
Can you try version 3.0.1-SNAPSHOT
please ?
I am trying to make the plugin compatible with Java and Kotlin. We were not using the abstract model of the gradle android plugin, but only tweeking the java gradle tasks directly.
Thanks for reporting this issue and following up !
@cooperkong ^
Hi, I don't see 3.0.1-SNAPSHOT
in maven central
Snapshots are in a different repo:
repositories {
...
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
Hi, @stephanenicolas it's working now with the snapshot! No need to manually add source set.
Good news @cooperkong , I am gonna merge the PR then. Are you sure you also removed the modification of the source set ?
If you want you can have a look at https://github.com/f2prateek/dart/blob/master/henson-plugin/src/functTest/groovy/dart/henson/plugin/HensonPluginFunctionalTest.groovy#L133
I would like to add a Kotlin functional test. Basically, I need some help to write this 2 classes in Kotlin:
package module1;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
class FooActivity extends Activity {
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
FooActivityNavigationModel foo = new FooActivityNavigationModel();
Intent intent = HensonNavigator.gotoFooActivity(this)
.s("s")
.build();
}
}
and
package module1;
import dart.BindExtra;
import dart.DartModel;
@DartModel()
class FooActivityNavigationModel {
@BindExtra String s;
}
I guess I can deal with the gradle setup. Thx already for your follow up!
Yeah sure.
package module1
import android.app.Activity
import android.os.Bundle
import android.content.Intent
class FooActivity : Activity() {
override fun onCreate(bundle :Bundle?) {
super.onCreate(bundle)
val foo = FooActivityNavigationModel()
val intent = HensonNavigator.gotoFooActivity(this)
.s("s")
.build()
}
}
package module1
import dart.BindExtra
import dart.DartModel
@DartModel
class FooActivityNavigationModel {
@BindExtra
lateinit var s : String
}
@cooperkong, I am close but it looks like Kotlin can't find the Henson navigator. I had to run the task manually to generate the navigator and it looks like I must also add the folder where the generated source is... Can you post the build file you use please ? (For the module that uses Henson generator).
I could get it solved @cooperkong , I was using a bad version of the henson plugin... We are gonna release the fix soon, with kotlin support. Thx a lot for your help.
@stephanenicolas Nice, can't wait!
PR merged https://github.com/f2prateek/dart/pull/218 ! Releasing in 1 hour.
Hi, almost feels like getting DH3 working đź‘Ť
except that I got below
Unresolved Reference
error, but it seems the correct files are already generated and IDE doesn't complaint about it. Only when running gradle builds.