Skip to content

Commit a4d75f6

Browse files
authored
<fix>(compiler): fix compiler use optimize by default. (#32)
1 parent 97c5a64 commit a4d75f6

File tree

4 files changed

+41
-7
lines changed

4 files changed

+41
-7
lines changed

.github/workflows/workflow.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java-SDK GitHub Actions
1+
name: SolcJ GitHub Actions
22
on:
33
push:
44
pull_request:
@@ -9,18 +9,42 @@ jobs:
99
build:
1010
name: build
1111
runs-on: ${{ matrix.os }}
12+
continue-on-error: true
1213
strategy:
14+
fail-fast: false
1315
matrix:
14-
os: [ubuntu-18.04, ubuntu-16.04, macos-latest]
16+
os: [ubuntu-20.04, ubuntu-22.04, windows-2019, macos-12]
1517
steps:
1618
- uses: actions/checkout@v2
1719
with:
1820
fetch-depth: 5
21+
- name: install Ubuntu dependencies
22+
if: runner.os == 'Linux'
23+
run: sudo apt update && sudo apt install -y git curl libssl-dev default-jdk build-essential
1924
- name: install macOS dependencies
2025
if: runner.os == 'macOS'
2126
run: brew install [email protected] openjdk
22-
- name: install Ubuntu dependencies
23-
if: runner.os == 'Linux'
24-
run: sudo apt-get update && sudo apt install -y git default-jdk
27+
- name: run build test
28+
if: runner.os == 'Windows'
29+
run: ./gradlew.bat build
30+
- name: run integration testing
31+
if: runner.os != 'Windows'
32+
run: /bin/bash .ci/ci_check.sh
33+
34+
build-centos:
35+
name: build-centos
36+
runs-on: ${{ matrix.os }}
37+
continue-on-error: true
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os: [ubuntu-20.04]
42+
container: docker.io/centos:7
43+
steps:
44+
- uses: actions/checkout@v2
45+
with:
46+
fetch-depth: 5
47+
- name: install CentOS dependencies
48+
run: yum install -y epel-release centos-release-scl which git openssl-devel openssl java java-devel
2549
- name: run integration testing
2650
run: /bin/bash .ci/ci_check.sh

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ build
1111
dist
1212
bin
1313
out
14+
gpg.gpg
15+
gradle.properties
16+
log4j.properties
17+
log**
18+
19+
## macOS
20+
.DS_Store

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ dependencies {
5454

5555
archivesBaseName = 'solcJ'
5656
group = 'org.fisco-bcos'
57-
version = '0.8.11.1'
57+
version = '0.8.11.2-SNAPSHOT'
5858

5959
// Additional attribute definition
6060
ext {

src/main/java/org/fisco/solc/compiler/SolidityCompiler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private void initSolc(boolean sm) {
4545
*/
4646
public static Result compile(File source, boolean sm, boolean combinedJson, Option... options)
4747
throws IOException {
48-
return getInstance().compileSrc(source, sm, true, combinedJson, options);
48+
return getInstance().compileSrc(source, sm, false, combinedJson, options);
4949
}
5050

5151
/**
@@ -386,6 +386,9 @@ private List<String> prepareCommandOptions(
386386
commandParts.add(option.getValue());
387387
}
388388
}
389+
for (Option option : getElementsOf(NameOnlyOption.class, options)) {
390+
commandParts.add("--" + option.getName());
391+
}
389392
// new in solidity 0.5.0: using stdin requires an explicit "-". The following output
390393
// of 'solc' if no file is provided, e.g.,: solc --combined-json abi,bin,interface,metadata
391394
//

0 commit comments

Comments
 (0)