something like this would do what you need

aidl in Android <<= (aidl in Android, genPath in Android) map { (a,g) =>
  val ga = g / "aidl"
  IO.copy(a map { f => f -> ga / (f relativeTo g).get.getPath })
  a foreach (_.delete())
}


On Sat, Jul 12, 2014 at 6:46 AM, Daniel Skinner <[email protected]> wrote:

> Actually this is with a lib project and I applied to main project and
> misinterpreted as working. Applied to lib, the gen'd java file just gets
> 'aidl' appended. Further, the plugin already should do this since its a
> gradle layout and I confirmed it does. But there's the dup outside of the
> aidl folder accompanied by a .java.d file. This apparently isn't a problem
> though except with repeated builds through the day, if the compile task
> fails along with some other undetermined factor, then I get the dup class
> error.
>
> The only consistent reproduction of the error is switching between release
> and debug builds.
> On Jul 12, 2014 12:15 AM, "Perry Nguyen" <[email protected]> wrote:
>
>> That doesn't actually resolve it, it just tells the compiler that there
>> aren't valid sources from the aidl task.
>>
>> To properly make it work with intellij you need to copy the results of
>> the aidl task into the aidl directory, delete the old files and return the
>> new list.
>>
>> I suppose the workaround works because it ignores the results of aidl.
>>
>> You can do a similar workaround by doing: aidl in Android := Nil
>>
>> Both of the above approaches should break a build that actually runs from
>> sbt.
>>
>> --
>> Sent from my phone
>> On Jul 7, 2014 3:36 PM, "Daniel Skinner" <[email protected]> wrote:
>>
>>> for now I've resolved this with
>>>
>>>     aidl in Android := (aidl in Android).value.map(_ / "aidl")
>>>
>>> though I'd really prefer intellij to not split up my gen files in sub
>>> directories.
>>>
>>>
>>> On Mon, Jul 7, 2014 at 4:42 PM, Daniel Skinner <[email protected]> wrote:
>>>
>>>> Last week, I was looking for a way to specify the aidl folder
>>>> explicitly in the android-sdk-plugin. The problem is intellij has a hard
>>>> coded "/aidl" in the specified gen directory that can't be removed (as far
>>>> as I can tell) as this often leads to annoying dup class files when
>>>> intellij is set to autogenerate files.
>>>>
>>>> There's the aidl TaskKey that can be overridden and so I was going for
>>>> a task override like
>>>>
>>>> aidl in Android := Seq(file("..."))
>>>>
>>>> but I'm not familiar enough with sbt to understand how to retrieve base
>>>> directory to produce an absolute path as required by the incremental
>>>> compiler. The code is in a class that holds common code and a def apply for
>>>> generating projects in the build.sbt file.
>>>>
>>>> Right now I was about to try something like
>>>>
>>>> aidl in Android := Seq((scalaSource in Compile).value / "...")
>>>>
>>>> But I'm wondering if there's something more correct, or even if I could
>>>> just override the hard coded aidl folder in intellij in the project files
>>>> somewhere.
>>>>
>>>> Thanks,
>>>> Daniel
>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "scala-on-android" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/scala-on-android/lum5KrtnSao/unsubscribe
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "scala-on-android" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "scala-on-android" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/scala-on-android/lum5KrtnSao/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "scala-on-android" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"scala-on-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to