Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/prepare v2 #22

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/1pl/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2"
"github.com/axone-protocol/prolog/v2/engine"
"io"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/1pl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (

"golang.org/x/crypto/ssh/terminal"

"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2"
"github.com/axone-protocol/prolog/v2/engine"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions examples/call_go_from_prolog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"net/http"

"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2"
"github.com/axone-protocol/prolog/v2/engine"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/dcg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"flag"
"fmt"

"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/v2"
)

// This example explains how to parse a simple English sentence with DCG (Definite Clause Grammar).
Expand Down
2 changes: 1 addition & 1 deletion examples/embed_prolog_into_go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/v2"
)

// http://www.cse.unsw.edu.au/~billw/dictionaries/prolog/cut.html
Expand Down
4 changes: 2 additions & 2 deletions examples/hanoi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"flag"
"fmt"

"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2"
"github.com/axone-protocol/prolog/v2/engine"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/initialization/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
_ "embed"
"os"

"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/v2"
)

//go:embed hello.pl
Expand Down
4 changes: 2 additions & 2 deletions examples/sandboxing/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package main

import (
"fmt"
"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2/engine"

"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/v2"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/axone-protocol/prolog
module github.com/axone-protocol/prolog/v2

go 1.23

Expand Down
2 changes: 1 addition & 1 deletion interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"strings"

"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2/engine"
)

//go:embed bootstrap.pl
Expand Down
2 changes: 1 addition & 1 deletion interpreter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2/engine"
"github.com/stretchr/testify/assert"
)

Expand Down
29 changes: 29 additions & 0 deletions scripts/bump-module.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -eo pipefail

major_version=$(cut -d. -f1 < version)
coderabbitai[bot] marked this conversation as resolved.
Show resolved Hide resolved

if [ "${major_version}" -gt 1 ]; then
module_name=$(go mod edit -json | jq -r '.Module.Path')
module_name_unversioned=$(echo "${module_name}" | sed -E 's|/v[0-9]+$||')
module_name_versioned="${module_name_unversioned}/v${major_version}"
echo "🔬 major version detected, updating module path to ${module_name_versioned}"
coderabbitai[bot] marked this conversation as resolved.
Show resolved Hide resolved

go mod edit -module "${module_name_versioned}"
echo "✅ module name updated to ${module_name_versioned} in go.mod"

if [ "$(uname)" = "Darwin" ]; then
find . -type f -name "*.go" -exec \
sed -i '' "s|\"${module_name}|\"${module_name_versioned}|g" {} \;
else
find . -type f -name "*.go" -exec \
sed -i "s|\"${module_name}|\"${module_name_versioned}|g" {} \;
fi
echo "✅ packages updated to ${module_name_versioned} in source files"
coderabbitai[bot] marked this conversation as resolved.
Show resolved Hide resolved

echo "🧹 cleaning up go.sum"
go mod tidy
else
echo "🙅version is not greater than 1, no need to update module path"
fi
2 changes: 1 addition & 1 deletion solutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"
"strings"

"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2/engine"
)

// ErrClosed indicates the Solutions are already closed and unable to perform the operation.
Expand Down
2 changes: 1 addition & 1 deletion solutions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

"github.com/axone-protocol/prolog/engine"
"github.com/axone-protocol/prolog/v2/engine"

"github.com/stretchr/testify/assert"
)
Expand Down
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0