|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
How do I build an addon that's in another folder?I need my addon for Io to be located not in my ~/io/addons folder but in my ~/myproject folder because "myproject" is a git repository, and I need the addon to be part of that git repository, not io's. I tried putting a symbolic link to the foldering into the io/addons, but that doesn't work because Io's Directory object categorizes the link as a file, not a folder. I tried modifying Project.io to pull files as well as folders, using 'Directory clone setPath(file path)' to transform the symbolic link's file object into a Directory object of the same name. (The link is the only file in my addons directory.) Specifically, I did:
modulesInFolder := method(name, folder := Directory clone setPath(name) if(folder exists not, return List clone) subfolders := folder directories <<<< BEGIN UGLY HACK >>>> folder files foreach(f, subfolders append(Directory clone setPath(f path))) <<<< END HACK HERE >>>> subfolders selectInPlace(fileNamedOrNil("build.io")) subfolders map(f, module := Lobby doString(f fileNamedOrNil("build.io") contents) module folder setPath(f path) module ) ) That actually got Io's build process to at least attempt to build it, but then I had a new problem: "../../whatever" in the -I../../includes done by the makefile actually get evaluated relative to the real path in ~/myproject/, not the addon's apparent path in ~/io/addons. Does anyone here work on Io addons that they do NOT keep in io/addons? How do you build them? Also, if I have a pre-built copy of Io, specifically the old Win32 build of Io from iolanguage.com, and I make a new add-on, how does the io.exe program load an addon that didn't exist when it started? I know it has something to do with the addon being a dll, but how does it find the dll? |
|
|
Re: How do I build an addon that's in another folder?On 2009-06-18, at 8:00 PM, dennisf486 wrote: > I tried putting a symbolic link to the foldering into the io/addons, > but that doesn't work because Io's Directory object categorizes the > link as a file Ok, let's fix that. Can you try changing the isDirectory function in IoDirectory.c to this: int isDirectory(struct dirent *dp, char *path) { #ifdef DT_UNKNOWN if (dp->d_type == DT_UNKNOWN) return 0; #endif { struct stat st; /*fstat( dp->d_fd, &st );*/ stat(path, &st); return ( (st.st_mode & S_IFMT) == S_IFDIR ); } } and see if that works? |
|
|
Re: How do I build an addon that's in another folder?Thanks. I'll try that this weekend. I didn't want to jump to the conclusion that it was an isDirectory bug because for all I know you might have needed it to work the way it did.
Please be aware that if you have the real directory in bar/ and a link in foo/, it seems that when you open one of these symbolically linked directories, the system accepts foo/linkname/whateverfile, but foo/linkname/.. incongruously gives you the bar/ directory, not foo/. Going down in the structure is ok, but trying to hop up out of the link directory doesn't give you the directory holding the link, it gives you the directory the link was really in. This is a problem for build scripts because you often have to refer to ../../someheader.h. --- In iolanguage@..., Steve Dekorte <steve@...> wrote: > > > On 2009-06-18, at 8:00 PM, dennisf486 wrote: > > > I tried putting a symbolic link to the foldering into the io/addons, > > but that doesn't work because Io's Directory object categorizes the > > link as a file > > Ok, let's fix that. Can you try changing the isDirectory function in > IoDirectory.c to this: > > int isDirectory(struct dirent *dp, char *path) > { > #ifdef DT_UNKNOWN > if (dp->d_type == DT_UNKNOWN) return 0; > #endif > { > struct stat st; > /*fstat( dp->d_fd, &st );*/ > stat(path, &st); > return ( (st.st_mode & S_IFMT) == S_IFDIR ); > } > } > > and see if that works? > |
| Free embeddable forum powered by Nabble | Forum Help |