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

IOS Translator improvements ( #1570

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sannysanoff
Copy link
Contributor

These changes are for the local workflow with the IOS ByteCode generator.
Initially, if you ran codegen several times, it produced different results, causing XCode to reparse and recompile lots of objc dode. This happened due to the 1) timestamp modifications 2) assembler labels to depend on JVM hashcode() which is random each time.
This pull request contains following changes:

  1. it offers PreservingOutputStream (drop-in replacement for FileOutputStream) which preserves timestamps if content did not change
  2. for template-based files, where in-file replacements are made, it initially creates file with suffix ".new", then it replaces it to original file name, keeping timestamp if content is equal to existing one.
  3. for labels, it overrides toString() adding integer sequences local to the classname, thus producting stable results each time.

Also pull request contains auto-generation of UIAppFonts array in -Info.plist file, because TTF file dropped into src dir did not work for me without this entry.

Also pull request contains .verbose and .draft flags of codegen taken from from System properties. "draft" flag (new) skips unused methods elimination, because for iterative development, it consumes biggest part of CPU time, and reduces generated objc linecount only by few percents (bug?)

Of course, default behaviour of flags is unchanged.

@codenameone
Copy link
Collaborator

Thanks, but this isn't something we need. You also missed a few things which you will pay for in compilation time later on.

@codenameone codenameone self-assigned this Aug 21, 2015
updated libzbar, hoped it is with bitcode, but ended switching off switches in project
@codenameone
Copy link
Collaborator

We've given some further thought to this patch and the general set of the Codename One VM and we think this would actually be an interesting enhancement. If you would like to proceed with this enhancement we can work on that. Is this patch merged with the latest version?

@codenameone codenameone reopened this Dec 9, 2015
@sannysanoff
Copy link
Contributor Author

I added more changes in addition to those mentioned at the time of the pull request, but probably few other places remain.

But due to the nature of header file where all indexes of all methods are listed (and every .c file depends on it), referencing more new methods in java always invalidates whole project.

But still, it is big help for me, and now my project depends on my branch. At the moment I solved all tasks related to my project that required to rebuild java->ios often, but project is ongoing and I will return to this field later.

@sannysanoff
Copy link
Contributor Author

Also, unused methods optimization may be commented out as it takes 80% of compilation time and removes only 20% of the code (for my project, at least). Needs to be parametrized via cmdline, too.

@codenameone
Copy link
Collaborator

I'd rather optimize the performance of the process rather than disable it but if you can make it into an option that would be fine.
Is your branch merged with the latest? Steve did some performance tuning work which might be valuable for your branch.

@codenameone codenameone removed their assignment Jul 8, 2020
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

2 participants