Skip to content

Commit

Permalink
Merge branch 'develop' into feature/tx_pre_execution
Browse files Browse the repository at this point in the history
# Conflicts:
#	yggdrash-core/src/main/java/io/yggdrash/core/blockchain/BlockChainImpl.java
  • Loading branch information
RachaelHong committed May 17, 2019
2 parents 64fe89c + 344c99e commit 3a9e223
Show file tree
Hide file tree
Showing 42 changed files with 2,023 additions and 770 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -36,7 +36,7 @@ ext {
logbackEsAppenderVersion = '1.6'
logbackJinoVersion = '3.0.12'
equinoxVersion = '3.13.0.v20180226-1711'
esVersion = '6.6.1'
elasticSearchVersion = '7.0.1'
}

allprojects {
Expand Down Expand Up @@ -111,7 +111,7 @@ project(':yggdrash-core') {
compile "com.google.code.gson:gson:${gsonVersion}"
compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
compile "com.typesafe:config:${typesafeVersion}"
compile "org.elasticsearch.client:transport:${esVersion}"
compile "org.elasticsearch.client:transport:${elasticSearchVersion}"
compile 'org.beryx:text-io:3.3.0'
compileOnly "javax.annotation:javax.annotation-api:${annotationVersion}"
testCompile "org.assertj:assertj-core:${assertjVersion}"
Expand Down
116 changes: 116 additions & 0 deletions contracts/stem/build.gradle
@@ -0,0 +1,116 @@
import java.security.MessageDigest

ext {
importPackage =
"io.yggdrash.common.contract" +
",io.yggdrash.common.contract.method" +
",io.yggdrash.common.contract.vo" +
",io.yggdrash.common.contract.vo.dpoa" +
",io.yggdrash.common.contract.vo.dpoa.tx" +
",io.yggdrash.common.crypto" +
",io.yggdrash.common.crypto.jce" +
",io.yggdrash.common.exception" +
",io.yggdrash.common.store" +
",io.yggdrash.common.store.datasource" +
",io.yggdrash.common.utils" +
",org.osgi.framework" +
",org.osgi.util.tracker" +
",com.google.gson" +
",org.w3c.dom" +
",org.slf4j" +
",java.math" +
",io.yggdrash.contract.core" +
",io.yggdrash.contract.core.annotation" +
",io.yggdrash.contract.core.store"


excludeList = ["META-INF/LICENSE", "META-INF/NOTICE", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "META-INF/NOTICE"]
}

// project directory setup
def rootPath = file('.').absolutePath
def buildContract = rootPath + '/build/contract'
def projectContractPath = rootPath + '/../../resources/contract'


task contractsPackage(type: Jar) {
//Add current module source
from(sourceSets.main.output) {
include "**"
exclude(["system-contracts"])
}

manifest {
attributes(
'Bundle-ManifestVersion': '2',
'Bundle-Name': 'StemContract',
'Bundle-Description': 'Stem Contract',
'Bundle-Vendor': 'YGGDRASH',
'Bundle-SymbolicName': 'io.yggdrash.contract.StemContract',
'Bundle-Version': '1.0.0',
'Bundle-Activator': 'io.yggdrash.contract.StemContract',
'Import-Package': "${importPackage}"
)
}
exclude(excludeList)
preserveFileTimestamps = false

// [archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]
project.archivesBaseName = manifest.attributes.get('Bundle-Name')
project.version = manifest.attributes.get('Bundle-Version')
}



def generateSha1(File file) {
MessageDigest md = MessageDigest.getInstance("SHA-1");
file.eachByte 4096, {bytes, size ->
md.update(bytes, 0, size);
}
return md.digest().collect {String.format "%02x", it}.join();
}

task deleteOutputContract(type: Delete) {
delete buildContract
}

task copyContractToResrouce(type: Copy) {
dependsOn deleteOutputContract
dependsOn contractsPackage

file("${buildContract}").mkdirs()

// Copy Contract File
from file('build/libs')
into file("${buildContract}")
exclude "${project.name}*"

doLast {
def libFiles = file("${buildContract}").listFiles()
libFiles.each {
def sha1Name = generateSha1(it)+'.jar'
def sha1File = file("${buildContract}/"+sha1Name)
if (it.getName().endsWith('.jar') && it.getName() != sha1Name) {
println it.getName() + ' -> ' + sha1Name
it.renameTo(sha1File)
}
}
}
}
task copyContractToProject(type: Copy) {
dependsOn copyContractToResrouce

from file("${buildContract}")
into file("${projectContractPath}")
}

jar {
dependsOn copyContractToProject
}

dependencies {
compile project(':yggdrash-common')
compile project(':yggdrash-contract-core')

testCompile project(':yggdrash-core')
}

0 comments on commit 3a9e223

Please sign in to comment.