Opened 11 months ago

Closed 9 months ago

#25022 closed enhancement (fixed)

Convert all scripts used for building to Ant tasks

Reported by: iwakeh Owned by: iwakeh, metrics-team
Priority: Medium Milestone:
Component: Metrics/Website Version:
Severity: Normal Keywords:
Cc: metrics-team Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

convert-sh comes to mind. This tasks should also look for other hidden shell scripts and streamline the usage of exec in ant tasks, e.g., always log to the ant log etc.

Child Tickets

Change History (16)

comment:1 Changed 11 months ago by iwakeh

Owner: changed from metrics-team to iwakeh
Status: newaccepted

Grabbing this as I'm already into this task.

comment:2 Changed 10 months ago by iwakeh

Status: acceptedneeds_review

Please review this commit, which replaces the last script used in metrics-web (I hope).

I think it is also not necessary anymore to store the specs' jsps, but I don't remember the exact reasoning.

comment:3 Changed 10 months ago by karsten

Cc: metrics-team added
Status: needs_reviewneeds_revision

Hmm, it doesn't work for me:

~/src/metrics-web$ ant generate-specs
Buildfile: /Users/karsten/src/metrics-web/build.xml

submoduleupdate:

init:

generate-specs:

xml2jsp:
     [echo] Generating bridge-descriptors specification jsp ... 
     [exec] awk: syntax error at source line 1
     [exec]  context is
     [exec] 	 >>> /Users/karsten/src/metrics-web/src/main/resources/spec/convert. <<< awk
     [exec] awk: bailing out at source line 1

BUILD FAILED
/Users/karsten/src/metrics-web/build.xml:231: The following error occurred while executing this line:
/Users/karsten/src/metrics-web/build.xml:262: exec returned: 2

Total time: 2 seconds
~/src/metrics-web$ find . | grep tmp
./${generated}/spec/bridge-descriptors.tmp
./${generated}/spec/bridge-descriptors.tmp2

The reason for leaving the generated JSPs under version control was that one wouldn't need to have to regenerate specs in order to build the website. Now we make that a requirement. I don't feel strongly about this.

(And again, I didn't get a notification for this ticket update...)

comment:4 in reply to:  3 Changed 10 months ago by iwakeh

Owner: changed from iwakeh to iwakeh, metrics-team
Status: needs_revisionassigned

Replying to karsten:

...
The reason for leaving the generated JSPs under version control was that one wouldn't need to have to regenerate specs in order to build the website. Now we make that a requirement. I don't feel strongly about this.

Ah, ok, the reasoning was that there are several tools needed, which might not generally be available, and having the resulting pages in version control would help here. So, the generated files should stay in git. I'll add a README file to the spec folder explaining this.

(And again, I didn't get a notification for this ticket update...)

Trying to assign the ticket to metrics-team, too.

comment:5 Changed 10 months ago by iwakeh

Status: assignedneeds_information

comment:6 Changed 10 months ago by iwakeh

Cc: metrics-team removed

comment:7 Changed 10 months ago by iwakeh

I think this is a mac issue. Could you remove the first line from 'convert.awk', i.e.

diff --git a/src/main/resources/spec/convert.awk b/src/main/resources/spec/convert.awk
index ab26121..8535cba 100644
--- a/src/main/resources/spec/convert.awk
+++ b/src/main/resources/spec/convert.awk
@@ -1,5 +1,3 @@
-#!/usr/bin/awk -f
-
 # Skip everything before <body> including generated header, script, and style.
 BEGIN {
   insidebody = 0;

and try 'ant clean generate-specs' again?
(I assume that 'awk' doesn't reside in '/usr/bin' on mac and that this causes the trouble.)

comment:8 Changed 10 months ago by karsten

No, that's not the issue. awk does reside in /usr/bin/awk, and commenting out that line doesn't resolve the issue.

Take a look at the ${generated} part below. That's an actual directory name that was not correctly resolved by Ant.

~/src/metrics-web$ find . | grep tmp
./${generated}/spec/bridge-descriptors.tmp
./${generated}/spec/bridge-descriptors.tmp2

Not sure why this works for you. What am I doing wrong?

comment:9 Changed 10 months ago by karsten

Cc: metrics-team added

Please leave metrics-team in cc. Otherwise I don't get notifications. Argh, Trac.

comment:10 in reply to:  8 Changed 10 months ago by iwakeh

Replying to karsten:

No, that's not the issue. awk does reside in /usr/bin/awk, and commenting out that line doesn't resolve the issue.

Take a look at the ${generated} part below. That's an actual directory name that was not correctly resolved by Ant.

Good point!

...

Not sure why this works for you. What am I doing wrong?

Did you run the bootstrap script?

comment:11 Changed 10 months ago by iwakeh

This waits for a reply to comment:10

comment:12 Changed 10 months ago by karsten

Yes, I think I did run the bootstrap script. Does it work for you if you run the bootstrap script?

comment:13 Changed 9 months ago by iwakeh

Status: needs_informationneeds_review

Please review the former branch with an additional fixup commit.

The property generated is not yet set at the time of creating property specdir. Linux can apparently deal with the funky pathname and didn't show the error above (comment:3). Now, all should work as expected.

comment:14 Changed 9 months ago by karsten

Looks better, but still doesn't work here. And I found out why: The awk on macOS doesn't know the --file command-line option, but only the -f option. Clearly.

Please review my commit 3be34c3 in my task-25022-2 branch with the following changes as compared to your branch:

  • rebased to current master,
  • changed --file to -f, and
  • put back the generated .jsp files.

comment:15 Changed 9 months ago by iwakeh

Status: needs_reviewmerge_ready

Looks fine and also works on linux.

comment:16 Changed 9 months ago by karsten

Resolution: fixed
Status: merge_readyclosed

Great, merged! Closing. Thanks!

Note: See TracTickets for help on using tickets.