Skip to content

package project

import "kaiju/editor/project"

Types

AndroidSettings

struct

type AndroidSettings struct {
    RootProjectName string
    ApplicationId   string
}

ConfigLoadError

struct

type ConfigLoadError struct {
    Err error
}

ConfigLoadError.Error

func (e ConfigLoadError) Error() string

Project

struct

type Project struct {
    // OnNameChange will fire whenever [SetName] is called, it will pass the
    // name that was set as the argument.
    OnNameChange        func(string)
    OnEntityDataUpdated events.EventWithArg[[]codegen.GeneratedType]

    // Has unexported fields.
}

Project is the mediator/container for all information about the developer's project. This type is used to access the file system, project specific settings, content, cache, and anything related to the project.

Project.BuildAndroid

func (p *Project) BuildAndroid(ndkHome, javaHome string, tags []string) error

Project.BuildRunAndroid

func (p *Project) BuildRunAndroid(ndkHome, javaHome string, tags []string) error

Project.CacheDatabase

func (p *Project) CacheDatabase() *content_database.Cache

ContentDatabase returns a pointer to [cache_database.CacheDatabase]

Project.Close

func (p *Project) Close() error

Close will finalize the closing of the project and save any unsaved configurations for the project. An error can be returned if there was an error saving the config.

Project.CompileDebug

func (p *Project) CompileDebug()

CompileDebug will build all of the Go code for the project without launching it. The build will be compiled using the 'debug' tag.

Project.CompileRelease

func (p *Project) CompileRelease()

CompileRelease will build all of the Go code for the project without launching it.

Project.CompileWithTags

func (p *Project) CompileWithTags(tags ...string)

CompileWithTags will build all of the Go code for the project without launching it. Any errors during the build process will be contained within an error slog. Look for the fields "error", "log", and "errorlog" for more details.

Project.EntityData

func (p *Project) EntityData() []codegen.GeneratedType

EntityData returns all of the generated/reflected entity data binding types

Project.EntityDataBinding

func (p *Project) EntityDataBinding(name string) (codegen.GeneratedType, bool)

EntityDataBinding will search through the generated/reflected entity data binding types for the one with the matching registration key

Project.FileSystem

func (p *Project) FileSystem() *project_file_system.FileSystem

FileSystem returns a pointer to project_file_system.FileSystem

Project.Initialize

func (p *Project) Initialize(path string, editorVersion float64) error

Initialize constructs a new project that is bound to the given path. This function can fail if the project path already exists and is not empty, or if the supplied path is to that of a file and not a folder.

Project.IsValid

func (p *Project) IsValid() bool

IsValid will return if this project has been constructed by simply returning if the file system for it has is valid.

Project.Name

func (p *Project) Name() string

Name will return the name that has been set for this project. If the name is not set, either the project hasn't been setup/selected or it is an error.

Project.Open

func (p *Project) Open(path string) error

Open constructs an existing project given a target folder. This function can fail if the target path is not a folder, or if the folder is deemed to not be a project. This will open a project in an empty folder. A project that is opened will check that all the base folder structure is in place and if not, it will create the missing folders.

Project.Package

func (p *Project) Package() error

Project.ReadSourceCode

func (p *Project) ReadSourceCode()

Project.Run

func (p *Project) Run(args ...string)

Project.SetName

func (p *Project) SetName(name string)

SetName will update the name of the project and save the project config file. When the name is successfully set, the [OnNameChange] func will be called.

Project.Settings

func (p *Project) Settings() *Settings

Project.TryUpgrade

func (p *Project) TryUpgrade() error

ProjectOpenError

struct

type ProjectOpenError struct {
    Path      string
    IsFile    bool
    IsMissing bool
}

ProjectOpenError.Error

func (e ProjectOpenError) Error() string

Settings

struct

type Settings struct {
    Name                 string
    ArchiveEncryptionKey string
    EditorVersion        float64 `visible:"false"`
    Android              AndroidSettings
}

Settings.Save

func (c *Settings) Save(fs *project_file_system.FileSystem) error