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

Add SkipAndroidAPK property to allow skipping producing an APK #8415

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Youssef1313
Copy link
Contributor

Sometimes, all a CI build needs is verifying that a project builds without errors. In those cases, producing an APK is a waste of time. This PR adds an option for that. Note that BuildingInsideVisualStudio can't be used because it can have too many other side effects.

@dellis1972
Copy link
Contributor

Thanks for the PR.

I can see this being useful. I have some feedback on this PR as it is though.

First we tend to prefix MSBuild properties which are going to be public (i.e don't have an _ prefix) with Android.
So in this case it would be AndroidSkipBuildApk or something like that.
Also we have to document every public MSbuild property in build-properties.md.

One thing to note, there is allot of processing which happens just prior to building the apk. For example the final aapt2 linking call and some java invocations. So this PR would only allow you to verify the C# side of the build.

@Youssef1313
Copy link
Contributor Author

Yes, for me the C# side of the build is what I do care about for now.

@jonathanpeppers
Copy link
Member

I was immediately going to suggest -p:BuildingInsideVisualStudio=true, but seems like you already tried. 😄

@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jpobst
Copy link
Contributor

jpobst commented Oct 18, 2023

Is there an existing MSBuild target that could be called that would stop before producing the APK? I know we used to only build the .dll at Build time, and didn't produce an APK until Deploy time.

If not, should there be a public target for that? It feels like this should be a target instead of a property?

@dellis1972
Copy link
Contributor

Is there an existing MSBuild target that could be called that would stop before producing the APK? I know we used to only build the .dll at Build time, and didn't produce an APK until Deploy time.

If not, should there be a public target for that? It feels like this should be a target instead of a property?

It was changed for .net 6 because the thinking was after a dotnet build you should be able to run the app, and publish is only used when creating the final release packages. I remember a long back and forth on this subject. I think we wanted to add a deploy command at one point, but that didn't happen.

@jpobst
Copy link
Contributor

jpobst commented Mar 19, 2024

Coming back to this, there are existing targets that might be able to fulfill this use case, though they are dependent on what the goal is.

  • CoreCompile: Compiles C# code
  • CoreBuild: Compiles C# code, generates and compiles Java interop code, compiles to Dalvik

Example:

dotnet build Foo.csproj -t:CoreBuild

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