package code_gen

import (
	"fmt"
	"os"
	"testing"
)

func TestDoGenerate(t *testing.T) {
	projName := "i2-erp-backend"

	path := "D:\\dev\\Go\\go_path\\src\\i2-erp-backend\\"
	projDir := fmt.Sprintf("%s%s.proj", path, projName)
	projMainXmlFileTemp := projDir + "/" + projName + "_temp.xml"
	_, err := os.Stat(projMainXmlFileTemp)
	if os.IsNotExist(err) {
		fmt.Println("-------------------------->remove project main file temp")
		os.Remove(projMainXmlFileTemp) // remove
	}

	DoGenerate(projMainXmlFileTemp, false)
}

func main() {
	projName := "i2-erp-backend"

	path := "D:\\dev\\Go\\go_path\\src\\i2-erp-backend\\"
	projDir := fmt.Sprintf("%s%s.proj", path, projName)
	projMainXmlFileTemp := projDir + "/" + projName + "_temp.xml"
	_, err := os.Stat(projMainXmlFileTemp)
	if os.IsNotExist(err) {
		fmt.Println("-------------------------->remove project main file temp")
		os.Remove(projMainXmlFileTemp) // remove
	}

	DoGenerate(projMainXmlFileTemp, false)
}
