GithubHelp home page GithubHelp logo

`--api` flag is not enough about vab HOT 17 CLOSED

vlang avatar vlang commented on May 30, 2024
`--api` flag is not enough

from vab.

Comments (17)

ArtemkaKun avatar ArtemkaKun commented on May 30, 2024 1

So, since --api defines the target SDK version, and there is already --min-sdk-version, and also Android documentation have the same name, for me, it's clear that we should have 2 flags: --min-sdk-version and --target-sdk-version (instead of --min-sdk-version and --api).

--list-apis lists installed APIs (SDKs?) on specific PC, and as far as I understand, it can stay the same.

It's a breaking change, but since we have CI checks this change should be handled with a low effort. I can submit a PR with this change and we will see.

If you don't want to change the naming - it's ok, I just thought that was a good improvement.

from vab.

Larpon avatar Larpon commented on May 30, 2024

We can't do much about the confusion Android has poured upon itself in this regard. I think --min-sdk-version is what you're looking for?

from vab.

ArtemkaKun avatar ArtemkaKun commented on May 30, 2024

Can't we specify minimum API? I plan to make a PR

from vab.

JalonSolov avatar JalonSolov commented on May 30, 2024

Doesn't the SDK version match the API version? If so, then --min-sdk-version does specify the minimum API.

from vab.

ArtemkaKun avatar ArtemkaKun commented on May 30, 2024

I should research a bit since I don't know

from vab.

JalonSolov avatar JalonSolov commented on May 30, 2024

https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels appears to say that I am correct... SDK version == API version.

from vab.

Larpon avatar Larpon commented on May 30, 2024

--min-sdk-version is what you are after. See https://developer.android.com/guide/topics/manifest/uses-sdk-element the flag is named after minSdkVersion. As I mentioned above, Android has done an extremely bad job at keeping things simple in this regard.

from vab.

ArtemkaKun avatar ArtemkaKun commented on May 30, 2024

--min-sdk-version is what you are after. See https://developer.android.com/guide/topics/manifest/uses-sdk-element the flag is named after minSdkVersion. As I mentioned above, Android has done an extremely bad job at keeping things simple in this regard.

Ok, so maybe we should rename --api flag then to --target-sdk-version?

from vab.

Larpon avatar Larpon commented on May 30, 2024

Also note that vab cannot go lower than level 21 for reasons I cannot sum up easily here. One includes the shift they made from gcc many years ago in the NDK. If you want to target anything lower than 21- I'll just wish you luck.

from vab.

ArtemkaKun avatar ArtemkaKun commented on May 30, 2024

I actually want the opposite - set the minimum target to 26

from vab.

Larpon avatar Larpon commented on May 30, 2024

--min-sdk-version is what you are after. See https://developer.android.com/guide/topics/manifest/uses-sdk-element the flag is named after minSdkVersion. As I mentioned above, Android has done an extremely bad job at keeping things simple in this regard.

Ok, so maybe we should rename --api flag then to --target-sdk-version?

Why? --api tells vab what API level to use?

IMO it's a breaking change that has little benefit to the mess Android has introduced to the environment already. In my opinion nobody can fix the API naming mess they've made no matter how we name our flags. On top --api is already documented. Also note that --list-apis will become the next inconsistency in this case, what should that flag be named? It's an irreversible mess that Google has made, that we should stay away from trying to fix IMO.

from vab.

Larpon avatar Larpon commented on May 30, 2024

I actually want the opposite - set the minimum target to 26

Then just use --min-sdk-version.

@ArtemkaKun sorry for editing your answer, GitHub on mobile web is not cool

from vab.

Larpon avatar Larpon commented on May 30, 2024

--api does not define the targetSdkVersion it defines the NDK API level compiler to use. vab then does it's best to make sure the SDK matches. Again; as I said: it's a mess and something that trips many Android developers. Remember: vab is based on the NDK, the SDK is only really needed for the packaging and Java interop and that the SDK != NDK.

Please make sure you understand how the API levels between the SDK and NDK is only related and how they in some cases aren't compatible before making any PRs:

Note that the definition of target API level in the NDK differs from the SDK. For the NDK, the target API level is the minimum supported API level for the app. If any non-ABI features are guarded by the target API level, they will only be available to apps with a minimum target that includes that API level.

This is one reason that it's called --api since it really doesn't have much to do with the targetSdkVersion when you're using the NDK.

from vab.

ArtemkaKun avatar ArtemkaKun commented on May 30, 2024

ezgif com-optimize

from vab.

ArtemkaKun avatar ArtemkaKun commented on May 30, 2024

Ok, seems things are more complicated than I thought 😅 Let's just leave --api alone for now

from vab.

Larpon avatar Larpon commented on May 30, 2024

If you don't want to change the naming - it's ok, I just thought that was a good improvement.

I'm always open to improvements, it's just that --api is not the targetSdkVersion, it's the API level compiler to use - and that's not 100% the same thing.

from vab.

Larpon avatar Larpon commented on May 30, 2024

Welcome to Android development in 2023+ 😅

from vab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.