Feel free to give it a try, happy to hear critique!KemyLand wrote:Didn't noticed this topic I was excepting it long ago
Capri 1.16 beta release!
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Capri 1.16 beta release!
Re: Capri 1.16 beta release!
HELLO MAX
After using makefiles for years, I've finally decided to switch, because they were mostly giving me headaches.
I have to say, in 20 minutes of using Capri, it's effing-fantastic.
Three things though:
1. Is it possible to define a variable at top-level of a Capri script 'statically'? Right now I'm trying to have a so-called 'project directory' using File.getCurrentDirectory(). Unfortunately, including this root-level build.capri script recomputes the function call, so I can't get a statically defined variable like that without hard coding it...
2. Somewhat related to (1), is it possible to dynamically import scripts at runtime? For instance looping through some files in a folder and calling import "{file}"; would be really cool!
3. Bug report... Unfortunately. Doing something like this:
somehow results in a "dependency failed for task 'all'"... except both compile and link are actually called, and return true.
After some digging, replacing
with
Solves the issue. Just a small bug, not exactly disastrous but hopefully worth looking into, yes?
Thanks! You have successfully rid me of my makefile addiction, hopefully this goes open source soon!
After using makefiles for years, I've finally decided to switch, because they were mostly giving me headaches.
I have to say, in 20 minutes of using Capri, it's effing-fantastic.
Three things though:
1. Is it possible to define a variable at top-level of a Capri script 'statically'? Right now I'm trying to have a so-called 'project directory' using File.getCurrentDirectory(). Unfortunately, including this root-level build.capri script recomputes the function call, so I can't get a statically defined variable like that without hard coding it...
2. Somewhat related to (1), is it possible to dynamically import scripts at runtime? For instance looping through some files in a folder and calling import "{file}"; would be really cool!
3. Bug report... Unfortunately. Doing something like this:
Code: Select all
task all depends build, buildLib;
task build depends compile, link;
task compile { ... }
task link { ... }
task buildLib { ... }
somehow results in a "dependency failed for task 'all'"... except both compile and link are actually called, and return true.
After some digging, replacing
Code: Select all
task build depends compile, link;
Code: Select all
task build { compile(); link(); }
Thanks! You have successfully rid me of my makefile addiction, hopefully this goes open source soon!
[nx] kernel: http://github.com/zhiayang/nx
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Capri 1.16 beta release!
Hello requimrar
Thanks a lot for the kind words and the feedback. Happy to see that its of use for others!
1. Could you give me an example? Yes it is possible to create a variable, task or simply write statements in the global scope.
2. Not yet, I've added it to my list
3. This is indeed not the way it should be, but I have a suspicion. Will update once fixed.
You can already get the sources in the capri release folder. I'm working on a website with a documentation, and also a public repository
Greets, Max
Thanks a lot for the kind words and the feedback. Happy to see that its of use for others!
1. Could you give me an example? Yes it is possible to create a variable, task or simply write statements in the global scope.
2. Not yet, I've added it to my list
3. This is indeed not the way it should be, but I have a suspicion. Will update once fixed.
You can already get the sources in the capri release folder. I'm working on a website with a documentation, and also a public repository
Greets, Max
Re: Capri 1.16 beta release!
Hey max, thanks for your quick reply.
To clarify, what I meant by the first point was this: say I have this code in "toplevel/build.capri"
Of course, this also defines a few more global variables like CXX etc, for convenience.
In "toplevel/sublevel/sublevel2/build.capri, I have this:"
What happens here is that 'sysroot' in the second file is computed using its context, meaning it is essentially
This means {sysroot}, to the sublevel capri script, is not 'toplevel/build/sysroot', but instead 'toplevel/sublevel/sublevel2/build/sysroot'.
PS: What can go inside the string-substitution curly braces {}? Just variable identifiers, or are arbitrary expressions (function calls) also allowed?
PPS: I might have another bug:
The task 'something' doesn't work properly in this case, I need to manually call somethingElse() from within it...
Anyway, it's still a fantastic job!
To clarify, what I meant by the first point was this: say I have this code in "toplevel/build.capri"
Code: Select all
projDir = File.getCurrentDirectory();
sysroot = File.getAbsolutePath("{projDir}/build/sysroot");
In "toplevel/sublevel/sublevel2/build.capri, I have this:"
Code: Select all
import "../../build.capri";
...
somethingRandom = "{sysroot}/usr/include";
What happens here is that 'sysroot' in the second file is computed using its context, meaning it is essentially
Code: Select all
File.getAbsolutePath("{File.getCurrentDirectory()}/build/sysroot");
PS: What can go inside the string-substitution curly braces {}? Just variable identifiers, or are arbitrary expressions (function calls) also allowed?
PPS: I might have another bug:
Code: Select all
task something depends somethingElse
{
}
Anyway, it's still a fantastic job!
[nx] kernel: http://github.com/zhiayang/nx
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Capri 1.16 beta release!
Oh, I see what you mean. This issue happens because getCurrentDirectory returns the directory in which capri is currently working in = the executed script location; anything that is imported is executed as if it was in the same script. I'll add something to work around this.
For the second thing, I've messed something up with the dependencies (as your previous example shows), I'll have a look over this stuff.
Thanks a lot for your feedback. Will add an update once this is fixed.
For the second thing, I've messed something up with the dependencies (as your previous example shows), I'll have a look over this stuff.
Thanks a lot for your feedback. Will add an update once this is fixed.
Re: Capri 1.16 beta release!
Thanks! (also, would it be possible to release a text mate syntax file for capri?)
[nx] kernel: http://github.com/zhiayang/nx
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Capri 1.16 beta release!
I'll create a BNF for Capri, I've never written a textmate syntax file, but feel free to contribute if you made onerequimrar wrote:Thanks! (also, would it be possible to release a text mate syntax file for capri?)
Sorry for the late reply, was sick, now working on bugfixes.
EDIT: Ah, to
You can put any expression in there, everything in there is interpreted and the return value (or for a simple variable the variable value) is inserted right at that location.requimrar wrote:PS: What can go inside the string-substitution curly braces {}? Just variable identifiers, or are arbitrary expressions (function calls) also allowed?
For example, a "Hello world" can be this:
Code: Select all
task print {
Utils.print("Hello ");
return "world";
}
Utils.println("{print()}");