+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

Build Java project with waf

发布于2020-10-30 21:48     阅读(192)     评论(0)     点赞(30)     收藏(2)


0

1

2

3

4

5

6

7

I have used this demo code to create a wscript that builds my java project. Now I want a jar file to be created in a different output directory than the one my class files are created in.

When I try to add this line:

jaropts = '-C default/src/ .', # can be used to give files

python says:

AttributeError: 'str' object has no attribute 'append'

Is it even possible to specify multiple output paths for individual files with waf and is jaropts the right place to configure that?

Traceback (most recent call last):
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Scripting.py", line 108, in waf_entry_point
    run_commands()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Scripting.py", line 169, in run_commands
    ctx=run_command(cmd_name)
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Scripting.py", line 160, in run_command
    ctx.execute()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Scripting.py", line 371, in execute
    return execute_method(self)
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Build.py", line 104, in execute
    self.execute_build()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Build.py", line 111, in execute_build
    self.compile()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Build.py", line 174, in compile
    self.producer.start()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Runner.py", line 170, in start
    self.refill_task_list()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Runner.py", line 98, in refill_task_list
    self.outstanding.extend(self.biter.next())
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Build.py", line 405, in get_build_iterator
    self.post_group()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Build.py", line 389, in post_group
    f()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/TaskGen.py", line 110, in post
    v()
  File "/home/user/java_test/.waf-1.8.10-f3a5181891ad6643633329fcfb4381b3/waflib/Tools/javaw.py", line 122, in jar_files
    jaropts.append('-C')
AttributeError: 'str' object has no attribute 'append'

解决方案


From looking at the source, jaropts should be an argument list, not a string.

Try jaropts = ['-C', 'default/src/', '.']

0

1

2

3

4



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接: https://www.pythonheidong.com/blog/article/609631/ffbc901791ffc15ab9e0/

来源: python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

30 0
收藏该文
已收藏

评论内容:(最多支持255个字符)