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

Not possible to build with newer Gradle #23

Closed
ghost opened this issue Jun 3, 2022 · 9 comments
Closed

Not possible to build with newer Gradle #23

ghost opened this issue Jun 3, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jun 3, 2022

Trying with latest Gradle...

javacppBuildCommand {
	// typically set here the buildCommand to the script that fills up includePath and linkPath
}

javacppBuildParser {
	// typically set here the classOrPackageNames to class names implementing InfoMap
}

javacppBuildCompiler {
	// typically set here boolean flags like copyLibs
}

tasks.withType(org.bytedeco.gradle.javacpp.BuildTask) {
	// set here default values for all build tasks below, typically just includePath and linkPath,
	// but also properties to set the path to the NDK and its compiler in the case of Android
	generate = true;
	compile = false;
	outputDirectory = new File("src/main/cpp");
}

Result:

> Task :javacppBuildParser FAILED
Execution optimizations have been disabled for task ':javacppBuildParser' to ensure correctness due to the following reasons:
  - Additional action of task ':javacppBuildParser' was implemented by the Java lambda 'org.bytedeco.gradle.javacpp.BuildPlugin$$Lambda$814/0x00000008012f1af0'. Reason: Using Java lambdas is not supported as task inputs. Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#implementation_unknown for more details about this problem.

Execution failed for task ':javacppBuildParser'.
> net/fabricmc/api/ModInitializer

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
@ghost ghost changed the title Not possible to build with newer Gradlew Not possible to build with newer Gradle Jun 3, 2022
@saudet saudet added the bug Something isn't working label Jun 4, 2022
@saudet
Copy link
Member

saudet commented Jun 4, 2022

It looks like Gradle doesn't like lambda expressions, so I've removed them in commit f80b2f3.
Please give it a try with the snapshots: http://bytedeco.org/builds/

@ghost
Copy link
Author

ghost commented Jun 4, 2022

Could not find javacpp-1.5.8-SNAPSHOT-android-arm.jar (org.bytedeco:javacpp:1.5.8-SNAPSHOT:20220604.134533-338).
Searched in the following locations:
    https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp/1.5.8-SNAPSHOT/javacpp-1.5.8-20220604.134533-338-android-arm.jar

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

@saudet
Copy link
Member

saudet commented Jun 4, 2022

The builds haven't finished, you'll need to wait until they do.

@ghost
Copy link
Author

ghost commented Jun 4, 2022

I had to make some edits to my project. The thing is that I'm developing a mod for Minecraft. JavaCpp doesn't know about the existence of net.fabricmc.api.ModInitializer; or any other third-party libraries.

tasks.withType(org.bytedeco.gradle.javacpp.BuildTask).configureEach {
	// set here default values for all build tasks below, typically just includePath and linkPath,
	// but also properties to set the path to the NDK and its compiler in the case of Android
	generate = true;
	compile = false;
	outputDirectory = file("$buildDir/../src/main/cpp");
	classOrPackageNames = ['org.helixd2s.yavulkanmod.alter.*'];
}

@saudet
Copy link
Member

saudet commented Jun 4, 2022

If it's having problems finding a class you need, you'll need to add those to the class path with the buildscript { } block:
https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies

@saudet
Copy link
Member

saudet commented Jun 5, 2022

We can have multiple BuildTask, that's not a problem.

@saudet
Copy link
Member

saudet commented Jun 5, 2022 via email

@saudet
Copy link
Member

saudet commented Jun 6, 2022

You probably won't be able to target the same files with more than one BuildTask, if that's what you're asking, that's normal.

@saudet
Copy link
Member

saudet commented Nov 3, 2022

The fix for this issue has been released with version 1.5.8. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant