Skip to main content



      Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » exportSrc
exportSrc [message #714917] Thu, 11 August 2011 14:28 Go to next message
Eclipse UserFriend
I do not seem to get this straight. Isn't the goal of the exportSrc to
add the src files to the release?

/* release containing only source files and build system */
releaseName = pkgName + "_src";
var src = pkg.addRelease(releaseName);
src.attrs.label = "src";
src.attrs.exportSrc = true;

I am forced to do the following:
src.otherFiles.$add("xyz.c")

Am I missing something?
Re: exportSrc [message #714948 is a reply to message #714917] Thu, 11 August 2011 16:59 Go to previous message
Eclipse UserFriend
If xyz.c is has not been added to any library or executable in the
package (via some addObjects() call), it will not be added to the
package's sources.

You can either:
1. add "xyz.c" to Pkg.otherSrcs array; see
http://rtsc.eclipse.org/cdoc-tip/index.html#xdc/bld/PackageContents.html#other.Srcs
2. add "xyz.c" to Pkg.otherFiles array; see
http://rtsc.eclipse.org/cdoc-tip/index.html#xdc/bld/PackageContents.html#other.Files,
or
3. add "xyz.c" to the release's otherFiles array (as you already
noted)

We intentionally did not add all *.c and *.h files in the package's
directory to the list of source files since this might inadvertently
place proprietary sources in a release. Moreover, we don't know all the
extensions that represent sources. You must either explicitly build the
file or add it to one of the arrays above for it to show up in a
"source" release.

If you want to add all *.c files in the package's directory, you can use
the Java file methods to list all such files and add these as above.
There is no harm to having the same file appear in more than one list;
e.g., even if "xyz.c" would have been considered a source file via the
addObjects() methods, it does not hurt to also put "xyz.c" in the
otherSrcs array. For example:

function ls(root, regExp)
{
if (regExp == null) {
regExp = /.*/;
}

/*
* ======== myFilter ========
* Return true if a file matches regExp; otherwise, return false.
*/
function myFilter(dir, file)
{
return (file.match(regExp) != null ? true : false);
}

/* create the filter */
var filter = java.io.FilenameFilter({accept : myFilter});

var file = new java.io.File(root);
var list = file.list(filter);

/* display the list */
for (var i = 0; i < list.length; i++) {
print(list[i]);
}
}

ls(".", /.*\.c/)


On 8/11/2011 11:28 AM, Patrick Geremia wrote:
> I do not seem to get this straight. Isn't the goal of the exportSrc to
> add the src files to the release?
>
> /* release containing only source files and build system */
> releaseName = pkgName + "_src";
> var src = pkg.addRelease(releaseName);
> src.attrs.label = "src";
> src.attrs.exportSrc = true;
>
> I am forced to do the following:
> src.otherFiles.$add("xyz.c")
>
> Am I missing something?
Previous Topic:package path resolution given package name
Next Topic:java.lang.OutOfMemoryError: Java heap space -- help
Goto Forum:
  


Current Time: Fri May 16 18:22:28 EDT 2025

Powered by FUDForum. Page generated in 0.03744 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top