Skip to content

Conversation

@gugavaro
Copy link
Contributor

@gugavaro gugavaro commented Nov 8, 2019

Generator currently generates invalid code if we try to bind a java library that contains classes/interfaces defined without/outside a java package.

The current behavior generates the following invalid code:


namespace  {

	// Metadata.xml XPath class reference: path="/api/package[@name='']/class[@name='Animal']"
	[global::Android.Runtime.Register ("/Animal", DoNotGenerateAcw=true)]
	public partial class Animal : global::Java.Lang.Object {
...

that will fail to build for obvious reasons.

Fix is to validate that classes and interfaces belong to a package/namespace. In case namespace does not exist, we should generate class or interface without any namespace.

Tests were added to validate scenario

tracking issue: #519

@jonpryor jonpryor merged commit 09083d9 into master Nov 12, 2019
@jonpryor jonpryor deleted the gugavaro_namespace branch November 12, 2019 15:38
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants