nimx icon indicating copy to clipboard operation
nimx copied to clipboard

Documentation for NimX is unclear.

Open ShockedCoder opened this issue 3 years ago • 3 comments

I cannot seem to find a solution to changing some of the attributes of "Builder".

I'm trying to do it like this after looking through the code:

import nimx/naketools
import strformat

const
    appName           = "CollectiveGallery"
    appVersion        = "1.0"
    javaPackageId     = &"eu.example.{appName}"
    activityClassName = &"{javaPackageId}.MainActivity"
    mainFile          = "src/CollectiveGallery"
    bin               = mainFile


var cgBuild = newBuilder() # cg = CollectiveGallery

cgBuild.appName           = appName
cgBuild.appVersion        = appVersion
cgBuild.javaPackageId     = javaPackageId
cgBuild.activityClassName = activityClassName
cgBuild.mainFile          = mainFile

beforeBuild(cgBuild)

But, as expected, this doesn't work and I'm met with a SIGSEGV error.

There also doesn't seem to be a way to change what name the binary ends up as.

ShockedCoder avatar Aug 09 '22 23:08 ShockedCoder

Here's how it should look like:

import nimx/naketools

# Your constants here ...

beforeBuild = proc(b: Builder) =
  b.mainFile = mainFile
  b.appName = appName
  # ... etc...

There also doesn't seem to be a way to change what name the binary ends up as.

True, there's no way to adjust final executable name. It is either appName.* or main.* depending on target platform. What is the reason you want the binary name to be different?

yglukhov avatar Aug 25 '22 08:08 yglukhov

What is the reason you want the binary name to be different?

A bit late because i forgor💀, but because why not?

There's no reason not to be able to have the name of the resulting executable not be customizable.

ShockedCoder avatar Oct 13 '22 22:10 ShockedCoder

You don't have to use naketools then. Just use nim c -r --threads:on <file>.nim

nixfreak avatar Jan 26 '23 21:01 nixfreak