Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Gradle setup #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yogurtearl
Copy link

@yogurtearl yogurtearl commented Nov 29, 2020

To build and run non-android tests:
./gradlew build

To run the Android TCK test: (addresses #78)
./gradlew connectedAndroidTest

If you change minSdk to 21 and run ./gradlew connectedAndroidTest the build will fail. (see #79)
https://github.com/yogurtearl/objenesis/blob/b6ee12c618897150d34651d28b6de479c8dcad7d/tck-android/build.gradle.kts#L29

With error:

D8: com.android.tools.r8.a: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)

@yogurtearl
Copy link
Author

@henri-tremblay thoughts? 😬

@henri-tremblay
Copy link
Contributor

henri-tremblay commented Dec 18, 2020 via email

To build and run non-android tests:
./gradlew build

To run the Android TCK test:
./gradlew connectedAndroidTest
To build and run non-android tests:
./gradlew build

To run the Android TCK test:
./gradlew connectedAndroidTest
@yogurtearl
Copy link
Author

@henri-tremblay thoughts on this gradle build? Using gradle is the easiest way to be able to maintain/run Android compatibility tests. :)

@henri-tremblay
Copy link
Contributor

Yes... A bit sadly but yes you are right. I want to deploy one last version with Maven to prevent any delay and then I will put my head into it.


plugins {
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
`kotlin-dsl`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why specify the Kotlin DSL and kts extension if none of the features are being used? Can cut down some CI time removing it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand. This is needed for precompiled script functions which we are using.
Without the kotlin-dsl plugin, it wouldn't create the org.objenesis.java-conventions.gradle.kts plugin.

Copy link

@Col-E Col-E May 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had assumed the the default build.gradle/groovy dsl would have sufficed for the definition of the plugin. From my experience the groovy dsl executes much faster on fresh systems (like a CI container) vs the kotlin dsl.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kotlin DSL gives better completion in the IDE.

Kotlin DSL performance was improved in Gradle 6.8.
https://docs.gradle.org/6.8.3/release-notes.html#kotlin-dsl-performance

Also, if CI caching is turned on the difference will be negligible.

@juliocbcotta
Copy link

What is missing to merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants