<commit_before>package jobs

import (
	"encoding/hex"
	"fmt"
	"os"
	"path/filepath"
	"strings"

	"github.com/hyperledger/burrow/execution/errors"
	"github.com/hyperledger/burrow/execution/exec"

	"github.com/hyperledger/burrow/crypto"
	compilers "github.com/hyperledger/burrow/deploy/compile"
	"github.com/hyperledger/burrow/deploy/def"
	"github.com/hyperledger/burrow/deploy/util"
	"github.com/hyperledger/burrow/execution/evm/abi"
	"github.com/hyperledger/burrow/txs/payload"
	log "github.com/sirupsen/logrus"
)

var errCodeMissing = fmt.Errorf("error: no binary code found in contract. Contract may be abstract due to missing function body or inherited function signatures not matching.")

func BuildJob(build *def.Build, binPath string, resp *compilers.Response) (result string, err error) {
	// assemble contract
	contractPath, err := findContractFile(build.Contract, binPath)
	if err != nil {
		return
	}

	log.WithField("=>", contractPath).Info("Contract path")

	// normal compilation/deploy sequence
	if resp == nil {
		log.Errorln("Error compiling contracts: Missing compiler result")
		return "", fmt.Errorf("internal error")
	} else if resp.Error != "" {
		log.Errorln("Error compiling contracts: Language error:")
		return "", fmt.Errorf("%v", resp.Error)
	} else if resp.Warning != "" {
		log.WithField("=>", resp.Warning).Warn("Warning during contract compilation")
	}

	// Save
	binP := build.BinPath
	if binP == "" {
		binP = binPath
	}

	for _, res := range resp.Objects {
		switch build.Instance {<commit_msg>Create bin directory for build jobs<commit_after>package jobs

import (
	"encoding/hex"
	"fmt"
	"os"
	"path/filepath"
	"strings"

	"github.com/hyperledger/burrow/execution/errors"
	"github.com/hyperledger/burrow/execution/exec"

	"github.com/hyperledger/burrow/crypto"
	compilers "github.com/hyperledger/burrow/deploy/compile"
	"github.com/hyperledger/burrow/deploy/def"
	"github.com/hyperledger/burrow/deploy/util"
	"github.com/hyperledger/burrow/execution/evm/abi"
	"github.com/hyperledger/burrow/txs/payload"
	log "github.com/sirupsen/logrus"
)

var errCodeMissing = fmt.Errorf("error: no binary code found in contract. Contract may be abstract due to missing function body or inherited function signatures not matching.")

func BuildJob(build *def.Build, binPath string, resp *compilers.Response) (result string, err error) {
	// assemble contract
	contractPath, err := findContractFile(build.Contract, binPath)
	if err != nil {
		return
	}

	log.WithField("=>", contractPath).Info("Contract path")

	// normal compilation/deploy sequence
	if resp == nil {
		log.Errorln("Error compiling contracts: Missing compiler result")
		return "", fmt.Errorf("internal error")
	} else if resp.Error != "" {
		log.Errorln("Error compiling contracts: Language error:")
		return "", fmt.Errorf("%v", resp.Error)
	} else if resp.Warning != "" {
		log.WithField("=>", resp.Warning).Warn("Warning during contract compilation")
	}

	// Save
	binP := build.BinPath
	if binP == "" {
		binP = binPath
	}

	if _, err := os.Stat(binP); os.IsNotExist(err) {
		if err := os.Mkdir(binP, 0775); err != nil {
			return "", err
		}
	}

	for _, res := range resp.Objects {
		switch build.Instance {
{'fraction_non_alphanumeric': 0.1399562636676039, 'fraction_numerical': 0.0012496094970321774, 'mean_word_length': 4.445578231292517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5660808', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1048, 'n_words': 245}