willir / cargo-ndk-android-gradle

Cargo NDK for Android projects
Apache License 2.0
55 stars 7 forks source link

Consider declaring Gradle outputs to speed up build. #17

Open surban opened 2 years ago

surban commented 2 years ago

Android Studio provides the following warning about the NDK plugin:

At 14:26, Nov 30, 2021, Android Studio detected the following issue(s) with Gradle plugin com.github.willir.rust.cargo-ndk-android

Always-Run Tasks
Task runs on every build because it declares no outputs.

Plugin: com.github.willir.rust.cargo-ndk-android
Task: buildCargoNdkDebug
Task type: com.github.willir.rust.CargoNdkBuildTask
Issues for the same task were detected in 1 module(s), total execution time was 3.3s (11.6%), by module:
  Execution mode: FULL, time: 3.3s (11.6%), determines build duration: true, on critical path: false, issues: Always-Run Tasks

====Build information:====
Execution date: 11/30/21, 2:26 PM
Total build duration: 38.9s
Configuration time: 7.6s (19.6%)
Critical path tasks time: 28.9s (74.2%)
Critical path tasks size: 47
AGP versions: 7.0.3
====Platform information:====
AI-203.7717.56.2031.7784292, JRE 11.0.10+0-b96-7249189x64 JetBrains s.r.o., OS Linux(amd64) v5.10.74.3-microsoft-standard-WSL2, screens 3840.0x2160.0, 3840.0x2160.0

AS: Arctic Fox | 2020.3.1 Patch 3; Kotlin plugin: 203-1.6.0-release-798-AS7717.8; Android Gradle Plugin: 7.0.3; Gradle: 7.0.2; Gradle JDK: version 11.0.10; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: 3.16.3

It only takes 3.3 seconds when the Rust code was unchanged. However, it would be nice if even that could be saved.

torokati44 commented 11 months ago

I assume/hope this would also allow pre-building the native libraries in some other way (in my case, in parallel for all 4 architectures in separate CI runners), and copying them to the right place, resulting in gradle skipping the Rust build entirely.