Closed GoogleCodeExporter closed 6 years ago
I created this task using the google code online editing tool. Not nearly as
nice as github.... So much easier to fork, comment and contribute over there.
Anyhow, there is some code cleanup you should consider:
1. you put too much stuff into doFirst
2. duplicate deletion of the dmg
3. ignore the dmg background completely
4. DMG is assembled in the same directory as the source files, causing an
error. You need to use a temp directory
Also, why do you use "->project" everywhere? I am not familiar with that syntax.
Original comment by aristede...@gmail.com
on 5 Oct 2012 at 3:41
I will take a look at this patch in a bit. But the basic rational for both the
doFirst and for the ->project syntax is to delay the evaluation of the
variables until they are used. Otherwise any configuration the user does
happens after the plugin is applied, meaning it has no effect. I do need to
clean this up though as I have learned a few things about writing plugins since
this code was written.
See this post for more info:
http://forums.gradle.org/gradle/topics/how_do_you_delay_configuration_of_a_task_
by_a_custom_plugin_using_the_extension_method
Original comment by crotwell@seis.sc.edu
on 5 Oct 2012 at 1:48
Maybe the problem is related to the way you instantiate the extension:
MacAppBundlePluginExtension pluginExtension = new MacAppBundlePluginExtension()
project.extensions.macAppBundle = pluginExtension
should be
project.extensions.create("macAppBundle", MacAppBundlePluginExtension)
Currently you have a lot of inconsistency between what you put inside doFirst
or what you use lazy gstrings for. I suspect that neither of those is hacks is
really needed.
Original comment by a...@glebeschool.org.au
on 8 Oct 2012 at 2:18
The main thing here is the temp folder for assembly. Any change of merging that
part?
Original comment by aristede...@gmail.com
on 25 Oct 2012 at 10:33
Can you tell me what the error is? It seems to work fine for me here.
Creating the DMG in another directory just to copy it to the output directory
seems a waste unless it is really needed.
Original comment by crotwell@seis.sc.edu
on 25 Oct 2012 at 12:51
Sorry for the delay in responding. The issue happens when some problem causes
the build to abort part way through. Then the next run will create an image
with the previous image inside. Using a temp folder location is vastly safer
and exactly what the temp folder is for. Since the temp folder is 99% of the
time on the same disk, there is no "waste" and the move executes in
milliseconds.
Original comment by aristede...@gmail.com
on 1 Mar 2013 at 2:07
Can you give me more information about the error? Gradle has pretty good up to
date checks, and so if there are files that are wrong from a previous build, it
sounds like I have missed something one of the task's inputs or outputs.
Perhaps using a temp folder would address this, but I would rather understand
and fix the root cause instead of putting a band aide on it.
Original comment by crotwell@seis.sc.edu
on 3 Mar 2013 at 3:23
Original issue reported on code.google.com by
aristede...@gmail.com
on 5 Oct 2012 at 3:24Attachments: