private attributes in Build.platformTable [message #1058] |
Tue, 10 February 2009 18:08  |
Eclipse User |
|
|
|
Champs,
Is it allowed to add my own private attributes to a platform instance in
Build.platformTable or can I only use instance create parameters?
For example, I would like to add the Linux kernel directory to my
platform instance for use by my test package build script.
Build.platformTable["ti.platforms.evmDM6446:Linux_2.6.28"] = {
kernelDir: "path/to/my/kernel/linux-2.6.28"
}
Thanks
~ Ramsey
|
|
|
|
|
Re: private attributes in Build.platformTable [message #1140 is a reply to message #1114] |
Wed, 11 February 2009 14:32   |
Eclipse User |
|
|
|
Ramsey Harris wrote:
>> Not really. You can add anything you want to the platformTable but
>> the only instance fields that you can access after the platform
>> instance is created are those instance fields defined by the
>> ti.platforms.evmDM6446.Platform module.
>>
>> However, this module _could_ provide the arguments passed in the
>> platformTable as an instance parameter. But this would be
>> platform-specific.
>
> All right, I understand that the platform instance will only see the
> properties defined by the platform module. What I would like to do is
> add private properties in the platformTable which a package build script
> would use at build time. I just want to confirm that doing this would
> not cause a problem when creating the platform instance. I don't need
> access to the private properties in the platform instance, just in the
> package build script. Is this allowed?
The current implementation explicitly removes properties not declared by
the Platform module _before_ creating the Platform instance. So .. it
will work.
However, others might argue that we should be generating an error for
these properties rather than silently "fixing" the object. Suppose, for
example, that you simply misspell a platform's instance creation
parameter. Without an error message, you will be pulling your hair out
trying to understand why the platform is not doing what you want.
If it weren't for backward compatibility, I'd fix the current
implementation to generate an error. In a future release when we have
some flexibility w.r.t. compatibility, we might implement this fix.
|
|
|
Re: private attributes in Build.platformTable [message #1168 is a reply to message #1140] |
Wed, 11 February 2009 15:01  |
Eclipse User |
|
|
|
dave russo wrote:
> The current implementation explicitly removes properties not declared by
> the Platform module _before_ creating the Platform instance. So .. it
> will work.
>
> However, others might argue that we should be generating an error for
> these properties rather than silently "fixing" the object. Suppose, for
> example, that you simply misspell a platform's instance creation
> parameter. Without an error message, you will be pulling your hair out
> trying to understand why the platform is not doing what you want.
>
> If it weren't for backward compatibility, I'd fix the current
> implementation to generate an error. In a future release when we have
> some flexibility w.r.t. compatibility, we might implement this fix.
Okay, I will not add my private properties to the platformTable object as this will likely break in the future. I'm glad I asked. Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.16106 seconds