forked from CalumJEadie/microbuild
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] How to get the parameters of a task? Is it possible? #23
Comments
Can you please take a few minutes and read the documentation? This is well
documented
…On Fri, Dec 13, 2019, 10:37 Jabba Laci ***@***.***> wrote:
I would like to use pynt for a Java project. The caller task looks like
this:
@task()
def run():
cmd = "java -cp build/classes/java/main adder.Adder"
print(cmd)
os.system(cmd)
Let's suppose that we can pass command-line arguments to the Java program:
bash$ java -cp build/classes/java/main adder.Adder 5 6
11
and it adds them together. Would it be possible to pass these arguments to
a task and then forward them to the Java program? I want a call like this:
bash$ pynt run 5 6
11
At the moment pynt thinks that "5" is another task and drops an error that
it doesn't exist.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#23?email_source=notifications&email_token=AABCJUUWZOMNPYHMURGU533QYPI4XA5CNFSM4J2TBEGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IAMXV5Q>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCJUWI7W5XPGDTJ5T26JLQYPI4XANCNFSM4J2TBEGA>
.
|
Thanks, I found it. I put it here for future references:
Normal call:
Call it via pynt:
However, this syntax is quite strange. Other build systems, like Rust's cargo, accept parameters like this: "cargo run 5 6". |
you will see the example calls to start, copyfile in the document
pynt "task[param1,param2,namedarg=value]"
…On Fri, Dec 13, 2019, 23:31 Jabba Laci ***@***.***> wrote:
I read the documentation but I didn't find it, that's why I asked.
@task()
def run(*args, **kwargs):
print(args)
print(kwargs)
I tried to catch the task parameters like this but they are empty, even if
I call it with pynt run 5 6.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#23?email_source=notifications&email_token=AABCJUX7AA4OD3GAHQIWDMTQYSDWPA5CNFSM4J2TBEGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG34MPQ#issuecomment-565691966>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCJUQY2ZUPQVC5EENIV53QYSDWPANCNFSM4J2TBEGA>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to use pynt for a Java project. The caller task looks like this:
Let's suppose that we can pass command-line arguments to the Java program:
and it adds them together. Would it be possible to pass these arguments to a task and then forward them to the Java program? I want a call like this:
At the moment pynt thinks that "5" is another task and drops an error that it doesn't exist.
The text was updated successfully, but these errors were encountered: