Re: [android-building] How to add relative path for srcs:[] in Android.bp

2019-10-18 Thread Akanksha
This works well, Thanks

On Friday, October 18, 2019 at 4:22:22 AM UTC+5:30, Dan Willemsen wrote:
>
> Here's an example of using a filegroup for this -- 
> cts/hostsidetests/media/common/**/*.java is used by two modules under 
> cts/hostsidetests/media/app/...
>
> So we've got the filegroup that defines all the files in the common 
> directory:
> cts/hostsidetests/media/Android.bp 
> 
> filegroup {
> name: "CtsMediaSessionTestCommon",
> srcs: ["common/**/*.java"],
> }
>
> And then used in the srcs list with ":CtsMediaSessionTestCommon":
> cts/hostsidetests/media/app/MediaSessionTest/Android.bp 
> 
> android_test_helper_app {
> name: "CtsMediaSessionHostTestApp",
> defaults: ["cts_defaults"],
> test_suites: [
> "cts",
> "vts",
> "general-tests",
> ],
> srcs: [
> "src/**/*.java",
>
> *":CtsMediaSessionTestCommon",*],
> static_libs: [
> "androidx.test.rules",
> "compatibility-device-util-axt",
> ],
> sdk_version: "test_current",
> min_sdk_version: "26",
> }
>
> In this case, it may have been possible to instead refactor the common 
> file into a library that would be used instead (and then only compiling the 
> files once instead of 2 times), but both would function.
>
> - Dan
>
> On Thu, Oct 17, 2019 at 3:08 PM REGURI AKANKSHA  > wrote:
>
>> Thanks,Dan I was able to tackle the above error. I am new to these 
>> things. Can u explain this  filegroup with an example, like by defining 
>> some module, that would be really helpful 
>> Thanks in advance
>>
>> On Thu, Oct 17, 2019 at 10:19 PM 'Dan Willemsen' via Android Building <
>> android-...@googlegroups.com > wrote:
>>
>>> We don't allow references outside of the current directory and its 
>>> subdirectories in Soong. We require the directory with the sources to 
>>> opt-into being used by others, either by directly defining the modules, or 
>>> by defining filegroup modules that can be used in the src[s] fields via 
>>> ":myfilegroup" (colon-prefixed module name). This way we can actually let 
>>> you control who uses files within your directory (via visibility), and 
>>> tools like `mma` and `atest` are more likely to be able to handle 
>>> "build/test everything in this directory" properly.
>>>
>>> So in this case, either move the Android.bp up to the parent path (which 
>>> usually makes sense for parents, or for apps that have "src" / "jni" / 
>>> "res" dirs, as we do automatically look for files in the same directory for 
>>> some things), or define a filegroup in the parent and use it below (this 
>>> can be more useful if the same file is used by multiple children, though it 
>>> may make more sense to use a static library or something more specific).
>>>
>>> That error is that you have multiple definitions of the same module, and 
>>> is unlikely to be related to just moving an Android.bp upwards (unless it 
>>> was below a `soong_namespace {}` definition, but that means you weren't 
>>> using that Android.bp in the first place).
>>>
>>> - Dan
>>>
>>>
>>> On Tue, Oct 15, 2019 at 8:27 AM  > 
>>> wrote:
>>>
 hello,
 say in a Android.bp file srcs:["../../../a.cpp"]
 I am getting the error Path is outside directory "../../../a.cpp"? How 
 to overcome this?

 Later I tried declaring Android.bp in to a parent folder so that 
 srcs:["a.cpp"] but then ,
 FAILED:
 build/make/core/base_rules.mk:325: error: /gps-noship/cacert_location: 
 MODULE.TARGET.ETC.cacert_location.pem already defined by /prebuilt_HY11.
 02:01:45 ckati failed with: exit status 1

  failed to build some targets (02:16 (mm:ss)) 

 How to overcome these?
 Thanks in advance

 -- 
 -- 
 You received this message because you are subscribed to the "Android 
 Building" mailing list.
 To post to this group, send email to android-...@googlegroups.com 
 
 To unsubscribe from this group, send email to
 android-...@googlegroups.com 
 For more options, visit this group at
 http://groups.google.com/group/android-building?hl=en

 --- 
 You received this message because you are subscribed to the Google 
 Groups "Android Building" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to android-...@googlegroups.com .
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/android-building/75ea2ea6-f85b-4577-a98c-1fd42f867150%40googlegroups.com
  
 
 .

>>> -- 
>>> -- 
>>> You received 

Re: [android-building] How to add relative path for srcs:[] in Android.bp

2019-10-17 Thread 'Dan Willemsen' via Android Building
Here's an example of using a filegroup for this --
cts/hostsidetests/media/common/**/*.java is used by two modules under
cts/hostsidetests/media/app/...

So we've got the filegroup that defines all the files in the common
directory:
cts/hostsidetests/media/Android.bp

filegroup {
name: "CtsMediaSessionTestCommon",
srcs: ["common/**/*.java"],
}

And then used in the srcs list with ":CtsMediaSessionTestCommon":
cts/hostsidetests/media/app/MediaSessionTest/Android.bp

android_test_helper_app {
name: "CtsMediaSessionHostTestApp",
defaults: ["cts_defaults"],
test_suites: [
"cts",
"vts",
"general-tests",
],
srcs: [
"src/**/*.java",

*":CtsMediaSessionTestCommon",*],
static_libs: [
"androidx.test.rules",
"compatibility-device-util-axt",
],
sdk_version: "test_current",
min_sdk_version: "26",
}

In this case, it may have been possible to instead refactor the common file
into a library that would be used instead (and then only compiling the
files once instead of 2 times), but both would function.

- Dan

On Thu, Oct 17, 2019 at 3:08 PM REGURI AKANKSHA 
wrote:

> Thanks,Dan I was able to tackle the above error. I am new to these things.
> Can u explain this  filegroup with an example, like by defining some
> module, that would be really helpful
> Thanks in advance
>
> On Thu, Oct 17, 2019 at 10:19 PM 'Dan Willemsen' via Android Building <
> android-building@googlegroups.com> wrote:
>
>> We don't allow references outside of the current directory and its
>> subdirectories in Soong. We require the directory with the sources to
>> opt-into being used by others, either by directly defining the modules, or
>> by defining filegroup modules that can be used in the src[s] fields via
>> ":myfilegroup" (colon-prefixed module name). This way we can actually let
>> you control who uses files within your directory (via visibility), and
>> tools like `mma` and `atest` are more likely to be able to handle
>> "build/test everything in this directory" properly.
>>
>> So in this case, either move the Android.bp up to the parent path (which
>> usually makes sense for parents, or for apps that have "src" / "jni" /
>> "res" dirs, as we do automatically look for files in the same directory for
>> some things), or define a filegroup in the parent and use it below (this
>> can be more useful if the same file is used by multiple children, though it
>> may make more sense to use a static library or something more specific).
>>
>> That error is that you have multiple definitions of the same module, and
>> is unlikely to be related to just moving an Android.bp upwards (unless it
>> was below a `soong_namespace {}` definition, but that means you weren't
>> using that Android.bp in the first place).
>>
>> - Dan
>>
>>
>> On Tue, Oct 15, 2019 at 8:27 AM   wrote:
>>
>>> hello,
>>> say in a Android.bp file srcs:["../../../a.cpp"]
>>> I am getting the error Path is outside directory "../../../a.cpp"? How
>>> to overcome this?
>>>
>>> Later I tried declaring Android.bp in to a parent folder so that
>>> srcs:["a.cpp"] but then ,
>>> FAILED:
>>> build/make/core/base_rules.mk:325: error: /gps-noship/cacert_location:
>>> MODULE.TARGET.ETC.cacert_location.pem already defined by /prebuilt_HY11.
>>> 02:01:45 ckati failed with: exit status 1
>>>
>>>  failed to build some targets (02:16 (mm:ss)) 
>>>
>>> How to overcome these?
>>> Thanks in advance
>>>
>>> --
>>> --
>>> You received this message because you are subscribed to the "Android
>>> Building" mailing list.
>>> To post to this group, send email to android-building@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-building+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-building?hl=en
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Building" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to android-building+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/android-building/75ea2ea6-f85b-4577-a98c-1fd42f867150%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> --
>> You received this message because you are subscribed to the "Android
>> Building" mailing list.
>> To post to this group, send email to android-building@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-building+unsubscr...@googlegroups.com
>> For more 

Re: [android-building] How to add relative path for srcs:[] in Android.bp

2019-10-17 Thread REGURI AKANKSHA
Thanks,Dan I was able to tackle the above error. I am new to these things.
Can u explain this  filegroup with an example, like by defining some
module, that would be really helpful
Thanks in advance

On Thu, Oct 17, 2019 at 10:19 PM 'Dan Willemsen' via Android Building <
android-building@googlegroups.com> wrote:

> We don't allow references outside of the current directory and its
> subdirectories in Soong. We require the directory with the sources to
> opt-into being used by others, either by directly defining the modules, or
> by defining filegroup modules that can be used in the src[s] fields via
> ":myfilegroup" (colon-prefixed module name). This way we can actually let
> you control who uses files within your directory (via visibility), and
> tools like `mma` and `atest` are more likely to be able to handle
> "build/test everything in this directory" properly.
>
> So in this case, either move the Android.bp up to the parent path (which
> usually makes sense for parents, or for apps that have "src" / "jni" /
> "res" dirs, as we do automatically look for files in the same directory for
> some things), or define a filegroup in the parent and use it below (this
> can be more useful if the same file is used by multiple children, though it
> may make more sense to use a static library or something more specific).
>
> That error is that you have multiple definitions of the same module, and
> is unlikely to be related to just moving an Android.bp upwards (unless it
> was below a `soong_namespace {}` definition, but that means you weren't
> using that Android.bp in the first place).
>
> - Dan
>
>
> On Tue, Oct 15, 2019 at 8:27 AM   wrote:
>
>> hello,
>> say in a Android.bp file srcs:["../../../a.cpp"]
>> I am getting the error Path is outside directory "../../../a.cpp"? How to
>> overcome this?
>>
>> Later I tried declaring Android.bp in to a parent folder so that
>> srcs:["a.cpp"] but then ,
>> FAILED:
>> build/make/core/base_rules.mk:325: error: /gps-noship/cacert_location:
>> MODULE.TARGET.ETC.cacert_location.pem already defined by /prebuilt_HY11.
>> 02:01:45 ckati failed with: exit status 1
>>
>>  failed to build some targets (02:16 (mm:ss)) 
>>
>> How to overcome these?
>> Thanks in advance
>>
>> --
>> --
>> You received this message because you are subscribed to the "Android
>> Building" mailing list.
>> To post to this group, send email to android-building@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-building+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-building?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Android Building" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to android-building+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/android-building/75ea2ea6-f85b-4577-a98c-1fd42f867150%40googlegroups.com
>> 
>> .
>>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-building+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-building/CALQgHd%3DXqqOGRCSHorr1UFV%3Dok%3DLHqEGmRrru9vGP%2BswDiZTxw%40mail.gmail.com
> 
> .
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/CA%2BVoWj7h3XMDiJY5ukqeMJnt7PPxAfLtrExG0BnLPY_%3DGp9Uyw%40mail.gmail.com.


Re: [android-building] How to add relative path for srcs:[] in Android.bp

2019-10-17 Thread 'Dan Willemsen' via Android Building
We don't allow references outside of the current directory and its
subdirectories in Soong. We require the directory with the sources to
opt-into being used by others, either by directly defining the modules, or
by defining filegroup modules that can be used in the src[s] fields via
":myfilegroup" (colon-prefixed module name). This way we can actually let
you control who uses files within your directory (via visibility), and
tools like `mma` and `atest` are more likely to be able to handle
"build/test everything in this directory" properly.

So in this case, either move the Android.bp up to the parent path (which
usually makes sense for parents, or for apps that have "src" / "jni" /
"res" dirs, as we do automatically look for files in the same directory for
some things), or define a filegroup in the parent and use it below (this
can be more useful if the same file is used by multiple children, though it
may make more sense to use a static library or something more specific).

That error is that you have multiple definitions of the same module, and is
unlikely to be related to just moving an Android.bp upwards (unless it was
below a `soong_namespace {}` definition, but that means you weren't using
that Android.bp in the first place).

- Dan


On Tue, Oct 15, 2019 at 8:27 AM   wrote:

> hello,
> say in a Android.bp file srcs:["../../../a.cpp"]
> I am getting the error Path is outside directory "../../../a.cpp"? How to
> overcome this?
>
> Later I tried declaring Android.bp in to a parent folder so that
> srcs:["a.cpp"] but then ,
> FAILED:
> build/make/core/base_rules.mk:325: error: /gps-noship/cacert_location:
> MODULE.TARGET.ETC.cacert_location.pem already defined by /prebuilt_HY11.
> 02:01:45 ckati failed with: exit status 1
>
>  failed to build some targets (02:16 (mm:ss)) 
>
> How to overcome these?
> Thanks in advance
>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-building+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-building/75ea2ea6-f85b-4577-a98c-1fd42f867150%40googlegroups.com
> 
> .
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/CALQgHd%3DXqqOGRCSHorr1UFV%3Dok%3DLHqEGmRrru9vGP%2BswDiZTxw%40mail.gmail.com.