Misterbates Active Member Licensed User Jul 20, 2017 #1 I have a project that I'm in process of porting from B4a to B4i. I've separated the core app logic into class files that can be used in either environment and B4A/B4i files that are specific to Android or iOS (mainly to do with the UI). I moved the class files into their own folder away from the main app and have put in place a couple of command files to update copies of the class files into the Shared Modules folder referenced by the B4A and B4i IDEs. For added security (and to avoid changing a class file without meaning to), I've made the copies of the class files in the Shared Modules folder READ-ONLY. And then in the main app I've added the class files from the Shared Module folder, so that the B4A/B4i apps link to them without making another local copy in the app folders. I'm now finding that when I save the app project I'm getting an IDE error (see attached). Removing the read-only flag from one of the shared class files, the only change appears to be in the "DesignText" at the start of the file - if last saved with B4A, it's changed to: Code: Copy Type=Class Version=7.01 ModulesStructureVersion=1 B4A=true @EndOfDesignText@ ... while if last saved with B4i it becomes: Code: Copy Type=Class Version=4.01 ModulesStructureVersion=1 B4i=true @EndOfDesignText@ Is there something that I can do to prevent accidental changes to the classes in the Shared Modules folder that would not result in an IDE error? Attachments Untitled.png 10.9 KB · Views: 406
I have a project that I'm in process of porting from B4a to B4i. I've separated the core app logic into class files that can be used in either environment and B4A/B4i files that are specific to Android or iOS (mainly to do with the UI). I moved the class files into their own folder away from the main app and have put in place a couple of command files to update copies of the class files into the Shared Modules folder referenced by the B4A and B4i IDEs. For added security (and to avoid changing a class file without meaning to), I've made the copies of the class files in the Shared Modules folder READ-ONLY. And then in the main app I've added the class files from the Shared Module folder, so that the B4A/B4i apps link to them without making another local copy in the app folders. I'm now finding that when I save the app project I'm getting an IDE error (see attached). Removing the read-only flag from one of the shared class files, the only change appears to be in the "DesignText" at the start of the file - if last saved with B4A, it's changed to: Code: Copy Type=Class Version=7.01 ModulesStructureVersion=1 B4A=true @EndOfDesignText@ ... while if last saved with B4i it becomes: Code: Copy Type=Class Version=4.01 ModulesStructureVersion=1 B4i=true @EndOfDesignText@ Is there something that I can do to prevent accidental changes to the classes in the Shared Modules folder that would not result in an IDE error?
Erel B4X founder Staff member Licensed User Longtime User Jul 20, 2017 #2 It will not work with readonly files. You can create another project (actually two as you need one for each platform) with the shared module and compile them to a library. This will allow you to reference the library instead of the shared modules. Upvote 0
It will not work with readonly files. You can create another project (actually two as you need one for each platform) with the shared module and compile them to a library. This will allow you to reference the library instead of the shared modules.