Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Use id and versionNumber from template application-descriptor #30

Closed
j3k0 opened this issue Sep 17, 2021 · 3 comments
Closed

Use id and versionNumber from template application-descriptor #30

j3k0 opened this issue Sep 17, 2021 · 3 comments

Comments

@j3k0
Copy link
Contributor

j3k0 commented Sep 17, 2021

I understand why id and versionNumber are pulled from the project config file, they're a bit of a special because they're probably the only fields absolutely required to get a valid application descriptor (when not using a source application-descriptor.xml I mean)

In our case, I would rather not use the values in the project.apm file and use values in the source xml file. However even setting them to null in the project config, it always erases the values I set.

@marchbold
Copy link
Contributor

These values are used through the additions merge process as well so it is important that they match. I'm actually more inclined to go the other way and provide more options in the project config than remove them.

Can you explain why you wouldn't want to have an accurate representation in the project file?

@j3k0
Copy link
Contributor Author

j3k0 commented Sep 17, 2021

It's a design choice:

1 project.apm aims to become the only source of truth, then it needs to be a full layer above the application descriptor.

  • in this scenario, the application descriptor is like an internal file format, never touched by the user.
  • all documentation and answered questions that exists online, explaining what to change in the application descriptor to fix certain issues, it's kinda invalidated.
  • more work.
  1. apm is a tool to manage the manifest and plist additions.
  • in this scenario, the application descriptor is the source of truth, project.apm only adds dependencies and configuration.

I was under the impression you were aiming for case 2 (not a full replacement for the app descriptor).

Additional thoughts. Have you considered making the project configuration an XML file? All AIR-related config files tend to be XML, our internal tooling is equipped for parsing XML, not JSON (which I like more, as a human, but you know, legacy...).

What if the config file was an extension of the application descriptor? Something like this:

<application>
  <id>my.id</id>
  <name>
    <text xml:lang="en">My App</text>
  </name>
  <versionNumber>1.15.0</versionNumber>
  <filename>App</filename>
  <description>
    <text xml:lang="en">App</text>
  </description>
  <copyright>Copyright 2016-2021, Fovea</copyright>
  <supportedLanguages>en fr es de ja ko nl pt pl</supportedLanguages>

  <initialWindow>
    <aspectRatio>landscape</aspectRatio>
    <renderMode>direct</renderMode>
    <autoOrients>true</autoOrients>
    <fullScreen>true</fullScreen>
    <visible>true</visible>
    <softKeyboardBehavior>none</softKeyboardBehavior>
  </initialWindow>

  <!--- NEW STUFF HERE --->

  <dependencies>
    <dependency>
      <id>starling-source</id>
      <version>2.7.0</version>
    </dependency>
  </dependencies>

  <configurations>
    <configuration key="getTaskAllow">false</configuration>
  </configurations>
</application>

That would also make scenario 1 almost immediate, right? Also that gives an almost immediate migration process to apm (apm would understand existing projects). Also existing knowledge still apply to apm.

Just an idea...

@marchbold
Copy link
Contributor

What I am aiming for is sort of like what you outline in 1, however not just replacing the app descriptor with the project.apm file, but with the apm tool itself. Both files would then be transparent to a developer except in advanced cases.

apm will be able to control all aspects of project.apm so this file format should be irrelevant, except in development and again advanced usage. This is even why we chose a different extension so as to clearly distinguish it.

I actually see potential to take the tool even further, with generating icons (including Assets.car / launch screens - which would be inserted into the app descriptor), build configurations for IDEs, and potentially even assembling build scripts. If this becomes the entry point for all libs, the majority of the information for configuring a build is contained here already.

The current approach of using the existing application descriptor as a template, is pretty much what you are suggesting. It allows immediate migration for an existing project, (as long as packages are available for all the ANEs in use) to apm with just supply of the application id and version (which is requested in the init process). It also allows all existing knowledge to apply. Also I think any existing documentation on what to change in the app descriptor would have a 1-to-1 corresponding fix in apm.

Maybe we could provide an option to apm init to process an existing app descriptor as an alternative to entering them manually?

@airsdk airsdk locked and limited conversation to collaborators Sep 24, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants