Skip to content

Commit ce4e690

Browse files
authored
feat: show compile and generate output (#106)
* feat: print compile and generate output to the terminal * chore: drop app spec compiler setting as default is arc56 now
1 parent 5556d98 commit ce4e690

File tree

7 files changed

+56
-14
lines changed
  • examples
    • generators
      • production_python_smart_contract_python/smart_contracts
      • production_python_smart_contract_typescript/smart_contracts
      • starter_python_smart_contract_python/smart_contracts
      • starter_python_smart_contract_typescript/smart_contracts
    • production_python/smart_contracts
    • starter_python/smart_contracts
  • template_content/smart_contracts

7 files changed

+56
-14
lines changed

examples/generators/production_python_smart_contract_python/smart_contracts/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,16 @@ def build(output_dir: Path, contract_path: Path) -> Path:
105105
"python",
106106
str(contract_path.resolve()),
107107
f"--out-dir={output_dir}",
108-
"--no-output-arc32",
109-
"--output-arc56",
110108
"--output-source-map",
111109
],
112110
stdout=subprocess.PIPE,
113111
stderr=subprocess.STDOUT,
114112
text=True,
115113
)
114+
115+
if build_result.stdout:
116+
print(build_result.stdout)
117+
116118
if build_result.returncode:
117119
raise Exception(f"Could not build contract:\n{build_result.stdout}")
118120

@@ -143,6 +145,10 @@ def build(output_dir: Path, contract_path: Path) -> Path:
143145
stderr=subprocess.STDOUT,
144146
text=True,
145147
)
148+
149+
if generate_result.stdout:
150+
print(generate_result.stdout)
151+
146152
if generate_result.returncode:
147153
if "No such command" in generate_result.stdout:
148154
raise Exception(

examples/generators/production_python_smart_contract_typescript/smart_contracts/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ def build(output_dir: Path, contract_path: Path) -> Path:
9999
"python",
100100
str(contract_path.resolve()),
101101
f"--out-dir={output_dir}",
102-
"--no-output-arc32",
103-
"--output-arc56",
104102
"--output-source-map",
105103
],
106104
stdout=subprocess.PIPE,
107105
stderr=subprocess.STDOUT,
108106
text=True,
109107
)
108+
109+
if build_result.stdout:
110+
print(build_result.stdout)
111+
110112
if build_result.returncode:
111113
raise Exception(f"Could not build contract:\n{build_result.stdout}")
112114

@@ -137,6 +139,10 @@ def build(output_dir: Path, contract_path: Path) -> Path:
137139
stderr=subprocess.STDOUT,
138140
text=True,
139141
)
142+
143+
if generate_result.stdout:
144+
print(generate_result.stdout)
145+
140146
if generate_result.returncode:
141147
if "No such command" in generate_result.stdout:
142148
raise Exception(

examples/generators/starter_python_smart_contract_python/smart_contracts/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,16 @@ def build(output_dir: Path, contract_path: Path) -> Path:
105105
"python",
106106
str(contract_path.resolve()),
107107
f"--out-dir={output_dir}",
108-
"--no-output-arc32",
109-
"--output-arc56",
110108
"--output-source-map",
111109
],
112110
stdout=subprocess.PIPE,
113111
stderr=subprocess.STDOUT,
114112
text=True,
115113
)
114+
115+
if build_result.stdout:
116+
print(build_result.stdout)
117+
116118
if build_result.returncode:
117119
raise Exception(f"Could not build contract:\n{build_result.stdout}")
118120

@@ -143,6 +145,10 @@ def build(output_dir: Path, contract_path: Path) -> Path:
143145
stderr=subprocess.STDOUT,
144146
text=True,
145147
)
148+
149+
if generate_result.stdout:
150+
print(generate_result.stdout)
151+
146152
if generate_result.returncode:
147153
if "No such command" in generate_result.stdout:
148154
raise Exception(

examples/generators/starter_python_smart_contract_typescript/smart_contracts/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ def build(output_dir: Path, contract_path: Path) -> Path:
9999
"python",
100100
str(contract_path.resolve()),
101101
f"--out-dir={output_dir}",
102-
"--no-output-arc32",
103-
"--output-arc56",
104102
"--output-source-map",
105103
],
106104
stdout=subprocess.PIPE,
107105
stderr=subprocess.STDOUT,
108106
text=True,
109107
)
108+
109+
if build_result.stdout:
110+
print(build_result.stdout)
111+
110112
if build_result.returncode:
111113
raise Exception(f"Could not build contract:\n{build_result.stdout}")
112114

@@ -137,6 +139,10 @@ def build(output_dir: Path, contract_path: Path) -> Path:
137139
stderr=subprocess.STDOUT,
138140
text=True,
139141
)
142+
143+
if generate_result.stdout:
144+
print(generate_result.stdout)
145+
140146
if generate_result.returncode:
141147
if "No such command" in generate_result.stdout:
142148
raise Exception(

examples/production_python/smart_contracts/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,16 @@ def build(output_dir: Path, contract_path: Path) -> Path:
105105
"python",
106106
str(contract_path.resolve()),
107107
f"--out-dir={output_dir}",
108-
"--no-output-arc32",
109-
"--output-arc56",
110108
"--output-source-map",
111109
],
112110
stdout=subprocess.PIPE,
113111
stderr=subprocess.STDOUT,
114112
text=True,
115113
)
114+
115+
if build_result.stdout:
116+
print(build_result.stdout)
117+
116118
if build_result.returncode:
117119
raise Exception(f"Could not build contract:\n{build_result.stdout}")
118120

@@ -143,6 +145,10 @@ def build(output_dir: Path, contract_path: Path) -> Path:
143145
stderr=subprocess.STDOUT,
144146
text=True,
145147
)
148+
149+
if generate_result.stdout:
150+
print(generate_result.stdout)
151+
146152
if generate_result.returncode:
147153
if "No such command" in generate_result.stdout:
148154
raise Exception(

examples/starter_python/smart_contracts/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,16 @@ def build(output_dir: Path, contract_path: Path) -> Path:
105105
"python",
106106
str(contract_path.resolve()),
107107
f"--out-dir={output_dir}",
108-
"--no-output-arc32",
109-
"--output-arc56",
110108
"--output-source-map",
111109
],
112110
stdout=subprocess.PIPE,
113111
stderr=subprocess.STDOUT,
114112
text=True,
115113
)
114+
115+
if build_result.stdout:
116+
print(build_result.stdout)
117+
116118
if build_result.returncode:
117119
raise Exception(f"Could not build contract:\n{build_result.stdout}")
118120

@@ -143,6 +145,10 @@ def build(output_dir: Path, contract_path: Path) -> Path:
143145
stderr=subprocess.STDOUT,
144146
text=True,
145147
)
148+
149+
if generate_result.stdout:
150+
print(generate_result.stdout)
151+
146152
if generate_result.returncode:
147153
if "No such command" in generate_result.stdout:
148154
raise Exception(

template_content/smart_contracts/__main__.py.jinja

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,16 @@ def build(output_dir: Path, contract_path: Path) -> Path:
113113
"python",
114114
str(contract_path.resolve()),
115115
f"--out-dir={output_dir}",
116-
"--no-output-arc32",
117-
"--output-arc56",
118116
"--output-source-map",
119117
],
120118
stdout=subprocess.PIPE,
121119
stderr=subprocess.STDOUT,
122120
text=True,
123121
)
122+
123+
if build_result.stdout:
124+
print(build_result.stdout)
125+
124126
if build_result.returncode:
125127
raise Exception(f"Could not build contract:\n{build_result.stdout}")
126128

@@ -151,6 +153,10 @@ def build(output_dir: Path, contract_path: Path) -> Path:
151153
stderr=subprocess.STDOUT,
152154
text=True,
153155
)
156+
157+
if generate_result.stdout:
158+
print(generate_result.stdout)
159+
154160
if generate_result.returncode:
155161
if "No such command" in generate_result.stdout:
156162
raise Exception(

0 commit comments

Comments
 (0)