Is there a way to programatically execute the "Create NSMangedObjectSubclass" command in XCode 4? - ios

I find it incredibly tedious every time I edit a core data model in the XCode model builder to select "Editor -> Create NSManagedObjectSubclass", then select the project group and directory in which to place the generated files, and agree that yes, I do want to replace their old versions.
It would be really great to have a one line shell command to generate these with a default group and directory. Does such a tool exist? If not, how would one go about writing such a tool?

I don't think there's any way to automate Xcode like that. The closest you can come is the generic UI automation functionality in AppleScript, but what you're asking for is pretty complex.
Instead, you may want to investigate mogenerator. It doesn't do the exact same thing that Xcode does, but it is basically a tool to regenerate CoreData classes as part of your build system, without interfering with custom code you may want to write for the class.

Related

Modifying Feature name at run time or using environment variable/system property in feature file

I have an automation project that i've recently updated to run both a set of Android and iOS tests in parallel. I've got my report files aggregating ok, but since they're running the same features, the reports at the end can't really identify which ran on Android and which on iOS.
It is a pretty standard Cucumber, Gherkin, Java project. I'm trying to figure out the best way to get the word Android/iOS into the Feature name field, so on the generated report it can be easily identified.
The two options i've thought about are either during the #Before step, to somehow modify the feature name. However, it looks like all of the fields of the Scenario object have getters only.
The second option was if it was possible to reference a system property or environment variable in the .feature file itself. However, I haven't seen any ways that that is possible.
Has anyone tried this before? I can post code as necessary, it is more of a general question of how could I dynamically change a feature name, or alter a feature file itself by environment variable when it runs.
Thanks
I think this similar question may have the answer you're seeking.
Basically, you're going to create your own runner type (or modify the existing one) and inside it set a custom report path.

Why is there a required build step for Web UI apps?

Why must we run a build.dart script to develop with web_ui ?
I thought it was an frequent noob question about web_ui but I do not find an answer about that. Maybe I miss some web resources or articles.
With Angular.js or Polymer MDV don't need it, and they use bidirectionnal binding.
With future version of Web_ui or Chronium version, does the build.dart will be still necessary ?
This side of web_ui disappoints me a little bit and I feel it could discourage developers to use it.
Another point is I don't like project organisation with HTML sources in "web" and another "web/out" directory ? Can we configure the script to have another out directory like "templates" for templates and "web" for output ?
Than
If you want to use #observable, then you need to run a code generation step. Because Dart is a more structured language, it's not currently possible to add methods or change structure of an object at runtime. Therefore, we must run through a small code generation step that converts #observable into the code to track and notify for changes.
Polymer doesn't need this because they can alter the object at runtime. Also, Object.observe is landing in V8 (already landed?) which means the runtime performs observability automatically.
We know this is a problem, and we have a few ideas on how to solve it.
Build a devserver that does the building for you automatically.
Implement (eventually) mirror builders, which would allow you to alter program structure at runtime.
Option 1 is a near-term solution, and option 2 is a long-term solution.

change monodevelop f# file order

I have started using MonoDevelop for F# on a Mac. It's pretty cool, except for the fact that it crashes quite a lot. One thing that is bothering me is that I can't change the order of the F# source files in a project. Is this possible? It will make organising projects a bit of a nightmare if it isn't.
Yes, you can reorder files. There is a special tab for doing that in project options (under the build tab).
Unfortunatelly, this cannot be done using the file browser (because MonoDevelop automatically sorts files by file name and there is no way to disable it).
Assuming you're using MonoDevelop 4.x and a recent version of F# Binding, you can drag and drop to move files into a correct order (no shortcut key supported yet).
Here is the original issue and the pull request if you're interested in (big thanks to Dave Thomas for implementing this).
As a last resort, you can open fsproj files in a text editor and rearrange xml nodes corresponding to source files.

Need to create a compiled delphi app that can make a separate compiled app

I need to make an app that will let users select some options, click a button, and a separate compiled app is created. Is this possible? I am using delphi 7 and 2010.
Thanks for the replies. Here is a little more info.
It would have to be a graphical app and create a graphical app.
What I want is the user to fire up 'App A' (I originally made), be able to select some options (I apologize for the secrecy. I think this is a million dollar idea that probably 3 people may find useful :) then use the program to create 'App B.' 'App B' can then be distributed to end users and 'App B' is a single executable that includes a compiled app plus the configuration data. I don't care how, but I need 'App B' to be a single executable.
I wouldn't even need to use Delphi for the final compiled app. If there is some sort of "pseudo-compiler" that I can call from Delphi that would marry a precompiled exe and a separate config file into a single executable. That would work just fine as well.
Thank you for the replies and help.
Thank you.
I also faced a similar situation once. I had to produce an exe using my exe. I didn't want to go the compiling a source code because of complexity and license problems.
Lets call the parent app P and child app C. Also lets assume that whatever option C needs can be summed up in a config file (XML/INI etc). What I ended-up doing was:
Create P and C. Inserted C in resource data of P.
When user clicked the button after selecting options, P would extract C from its resource data.
Created an XML file containing the options selected by user and inserted it in C's resource data.
So whenever C will run, it will use the options given in the XML file stuffed in it. It looks like complicated and hacky but is reliable and simple. Do a google on "delphi embedding resource in exe" and you will find plenty of articles to do above.
It is possible. You will need a Delphi 7 (or compatible) compiler (command line at least) on the target machine. You will also need all the source code for the compiled application and that includes all the third party libraries if you use any.
When you have it all set just call the command line compiler (DCC32.EXE) with the proper parameters and paths.
You can use two approaches for this:
Call ShellExecute
Call CreateProcess
You will have more control over the execution with CreateProcess. Also you will have to watch out for legal issues and licences if you plan to use the compiler this way.
Given that the Delphi compiler can't be redistributed, one solution if the user has not a copy of Delphi may be to use a script engine (i.e. RemObjects PascalScript, but there are others), generate code for it, and embed that code (i.e. within a resource) in an executable that will execute it when launched.
Create a separate stub executable that implements all the logic you need, and that reads its configuration from its own local resources (look at the TResourceStream class to help you load a resource at runtime).
Include that stub executable as an RCDATA resource in your main app's resources when it is compiled.
At runtime, the main app can extract the stub executable from its resources when needed, save it to disk, and insert the necessary configuration data into the stub's resources using the Win32 API UpdateResource() function.
Without knowing more about why you think you need to do this, I assume you don't actually need to do this. Given the stated requirements, I'd simply have one app, written in Delphi, that looks for the existence of configuration data (.ini file, registry, etc..) In the absence of this, it presents a screen that "will let users select some options, click a button". Then the options are stored in a .ini file, and the rest of the program proceeds, making use of those options.
Alternately, I'd use some pascal scripting, such as provided by TMS.
If you are looking for a way to crank out custom-branded versions of an app, maybe use Inno Setup with a ResHacker step. i.e. gather requirements in Inno, spit out your .exe into a temp directory, use ResHacker to modify the .exe, copy it into the program folder.

How do I run all projects in a project group?

I have a project group containing two projects that share one source folder,but do different things.What I find strange is the use of 'project group',but I don't want to turn this a subjective question,thereby I directly ask you:
How do I run all the projects in a project group - is there a short way?
Thank you in advance!
Actually, all of you are wrong. You can debug multiple programs at the same time.
I don't know when this was first implemented, most probably when the project groups were added to the Delphi, but I'm using this since "forewer" and I'm sure that at least Delphi 2005 was capable of doing it.
In short:
Create a project group with two programs.
Build them all! You won't be able to use the compiler after you start the debugger.
Activate the first program (double-click on its name in the Program Manager) and press F9 (run).
Activate the second program in the Program Manager (you cannot use the drop-down next to the "Run" toolbar button for that as it will become disabled in the previous step) and press F9.
Voila! You have two programs running under the debugger. You can set breakpoints in any of them and they will work just file.
This approach works with any number of programs. (There may be some hardcoded limitations but I've never run into them.)
The debugger can debug only one application (actually: Process) at the time, and if you run from the IDE it is in the debugger.
So I think the answer is : you can't.
Well, I guess unless you count dlls that are launched in the same process, but are individual projects. (seeing the other post), but I never tried that.
To run all the projects at once, add a new batch file to your project group. Make the batch file run each program, and when you want to run them all later, simply choose the batch file in the project group and run it. This isn't the same as debugging all the projects, just running them. It's simply a way to automate the procedure given in Bruce's answer.
You can only debug one project at a time, but you can run as many as you like from the IDE without debugging.
Shift + Ctrl+ F9
Update: I stand corrected. You can debug multiple projects at the same time. Excellent for debugging a client and a server at the same time.
The projectgroup is a tool to build multiple projects.
You can select build all from here to build them all.
You can run several from within the debugger if one is a program and the others are dlls that are used by the program.
Multiple programs's can't be run/debugged at the same time.
Although you can use a program as a DLL but I'm not sure if the IDE can handle that use. In that case you can use a main procedure which is the only thing called from the main program. Then you should export this main proc. Create an additional exe project that calls all of them from different threads. I have not tested this. And it is a hack, but it could probably work.
But why do you want to run/debug several apps at the same time?
As a side note: Check all dependent projects (right click on project -> Dependencies) to have them build automatically before debugging.

Resources