Skip to content

Commit

Permalink
Merge pull request #12 from tbocek/master
Browse files Browse the repository at this point in the history
Update to solc 0.4.24
  • Loading branch information
mkalinin authored Jun 22, 2018
2 parents e88b9ef + 09b871f commit a7f2ba3
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ https://bintray.com/ethereum/maven/org.ethereum.solcJ-all/

Can be included in gradle via:
```
compile 'org.ethereum:solcJ-all:0.4.23'
compile 'org.ethereum:solcJ-all:0.4.24'
```

We use jar in EthereumJ project, where we add addition layer of classes to interact with `solc`:
Expand All @@ -20,7 +20,7 @@ And then we use code snippet for compilation:

```
String contractSrc =
"pragma solidity ^0.4.23;\n" +
"pragma solidity ^0.4.24;\n" +
"contract a {" +
" function() {throw;}" +
"}";
Expand Down
47 changes: 32 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
group 'org.ethereum'
version '0.4.23'


buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
}
plugins {
id 'java'
id 'maven'
id 'maven-publish'
id 'com.jfrog.bintray' version '1.7'
id "de.undercouch.download" version "3.4.3"
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
group 'org.ethereum'
version '0.4.24'

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.properties['bintrayUser']
Expand Down Expand Up @@ -55,3 +48,27 @@ test {
println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
}

task downloadStaticLinuxFile(type: Download) {
src "https://github.com/ethereum/solidity/releases/download/v${version}/solc-static-linux"
dest "${projectDir}/src/main/resources/native/linux/solc/solc"
}

task downloadWindowsZipFile(type: Download) {
src "https://github.com/ethereum/solidity/releases/download/v${version}/solidity-windows.zip"
dest new File("${buildDir}/tmp", 'solidity-windows.zip')
}

task unzipFile(dependsOn: downloadWindowsZipFile, type: Copy) {
from zipTree(downloadWindowsZipFile.dest)
into "${projectDir}/src/main/resources/native/win/solc"
}

task cleanUpFiles(dependsOn: unzipFile, type: Delete) {
delete "${projectDir}/src/main/resources/native/win/solc/soltest.exe"
}

assemble.dependsOn downloadStaticLinuxFile
assemble.dependsOn cleanUpFiles


2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
32 changes: 32 additions & 0 deletions instructions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
-----
0.4.24
#### Mac

Follow this [guide](https://solidity.readthedocs.io/en/latest/installing-solidity.html#binary-packages)):

```
brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity
# then copy the library to ${DEST}/src/main/resources/native/mac/solc/solc
```

#### Linux

Take binaries from https://github.com/ethereum/solidity/releases

#### Windows

Take binaries from https://github.com/ethereum/solidity/releases


#### Final
* Copy all binaries to solcJ project
* Update hardcoded version in `SolcVersion.java` class and in `build.gradle`
* Publish to bintray with: `./gradlew clean jar bintrayUpload -DbintrayUser=XXXX -DbintrayApiKey=YYYY`

Scripts for compiling the binaries are provided in the scripts directory. Those are left as an alternative to compile the binaries.


-----
0.4.23
#### Mac
Expand Down
4 changes: 2 additions & 2 deletions scripts/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ RUN cd jsoncpp \
WORKDIR /src/solidity/build

RUN git pull
RUN git checkout v0.4.23
RUN git checkout v0.4.24

# don't use nightly versioning for releases
RUN echo -n > ../prerelease.txt

RUN cmake -DCMAKE_BUILD_TYPE=Release \
-DTESTS=1 \
-DSTATIC_LINKING=1 \
-DSOLC_LINK_STATIC=ON \
..

RUN make --jobs=2 solc soltest
Expand Down
2 changes: 1 addition & 1 deletion scripts/win/run.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set "DEST=%cd%"
set VERSION="0.4.8"
set VERSION="0.4.24"
cd ..
mkdir solidity-builds
cd solidity-builds
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/ethereum/solcJ/SolcVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
*/
public class SolcVersion {

public static final String VERSION = "0.4.23";
public static final String VERSION = "0.4.24";
}
Binary file modified src/main/resources/native/linux/solc/solc
100644 → 100755
Binary file not shown.
Binary file modified src/main/resources/native/mac/solc/solc
Binary file not shown.
Empty file modified src/main/resources/native/win/solc/msvcp140.dll
100755 → 100644
Empty file.
Binary file modified src/main/resources/native/win/solc/solc.exe
100755 → 100644
Binary file not shown.

0 comments on commit a7f2ba3

Please sign in to comment.