Solar2D IDE on iPad

Just a quick update…I didn’t get to upload to TestFlight yesterday because it seems CoronaCards is using the mic and camera…and Apple wants me to somehow clear that up. Giving it another attempt right now.

As for that require hack I spoke about above, here’s the source if anyone wants it.

local oldRequire = require

local function newSafeTbl()
    local tbl = {}
    local meta = {}
    local function returnSelf()
        return tbl
    end
    meta.__index = returnSelf
    meta.__newindex = returnSelf
    meta.__add = returnSelf
    meta.__sub = returnSelf
    meta.__mul = returnSelf
    meta.__div = returnSelf
    meta.__idiv = returnSelf
    meta.__lt = returnSelf
    meta.__mod = returnSelf
    meta.__pow = returnSelf
    meta.__concat = returnSelf
    meta.__unm = returnSelf
    meta.__call = returnSelf
    setmetatable(tbl, meta)
    return tbl
end

function require(path)
    local status, res = pcall(oldRequire, path)
    if status then
        return res
    else
        return newSafeTbl()
    end
end

When you try to require a library that exists, it works normally. But if the library doesn’t exist now, it will return this “safe table”. The safe table makes it near impossible to get a runtime error. Here’s a test I run it against. I try importing a non-existent library called “composer2”.

local composer2 = require "composer2"
composer2.a.c = 3
local x = composer2.a.c + composer2.a.c
local xy = composer2.a.c - composer2.a.c
local xy = composer2.a.c == composer2.a.c
local xy = composer2.a.c <= composer2.a.c
local xy = composer2.a.c < composer2.a.c
local xy = composer2.a.c > composer2.a.c
local xy = composer2.a.c >= composer2.a.c
local x = composer2.a.c * composer2.a.c
local xy = composer2.a.c / tostring(composer2.a.c)
local xy = -composer2.a.c % composer2.a.c
local xy = composer2.a.c ^ tostring(composer2.a.c())
local xy = composer2.a.c .. composer2.a.c
print(composer2.a.c[4])

Each one of the math operators, assignments, value access, etc I run on it, it will just ultimately return itself. Hopefully this will be enough for those depending on certain libraries to at least run their games without those libraries in App Maker :smiley:

It looks really cool on the iPhone too! And now we’re just waiting for Apple to approve my last Testflight submission

3 Likes

Hi @joecoronasdk , any update on this?

1 Like

Yes sorry things got busy the last 2 weeks, but it’s working and on Testflight. Message me your email and I can get you a download link! :slight_smile:

I sent you my email as requested but no answer? Is everything okay?

Everything ok! Sorry life and work got in the way. I’ll respond to that message right now :slight_smile:

Have you had a chance to implement some of the common plugins?

1 Like

@joecoronasdk - Awesome! I love when someone steps around an implausibility with ease and grace. Great work!

1 Like

Quick update on the IDE: I’m been mostly busy with the new Swift interpreter the IDE uses for native app development. But Solar features will still come, they just aren’t a top priority as most users are iOS developers.

Stay tuned :slight_smile: and thanks for the positive comments

1 Like

Hi Joe, but you know, I’m an iOS developer, too, but I use Solar2D to make my apps. I have 4 on the App Store and there are hundreds by others, too. Please let us know when you can build in support for the plugins. You really have something great.

1 Like

I’m getting a repo up soon where you can add in your own plugins to the IDE—including Solar2D plugins via CoronaCards. This would allow you to customize your iPad IDE to support any Solar plugins your games need. :slight_smile: Ping me if I don’t update this thread in the next month.

1 Like

Another update: I got the custom build system for App Maker working. This means it’s possible to extend App Maker with plugins. I’m now adding CoronaCards as a plugin option. But I still need to figure out how to get native Solar plugins to build and integrate with CoronaCards though.

I’m fairly sure Vlad could be helpful. Are you connecting with him about this?

1 Like

Good idea! Once I get as far as I think I can, I’ll touch base with him if I need it. I know he’s probably very busy haha!

But I might be able to do it on my own. I had to take a break during this last week as I was both moving and busy with another project. But as of today I’m back on it :slight_smile:

Just a small kinda-big update on how the custom App Maker builds is coming along.

Here’s the folder that will be open sourced soon.

First thing of interest is the AppMakerCoreWrapper folder. It contains the majority of App Maker…precompiled! So you won’t have access to my source code :stuck_out_tongue:

Next is the setup.yml file. Here you can configure what you want included in your custom App Maker build.

Here’s how my setup.yml looks right now. You can see if have the ZipExport and Solar2D plugins set for the iOS and macOS builds. Meanwhile the GitProviders plugin is disabled by being commented out.

So now when I run build-xcode-project.py, I get a new AppMaker.xcodeproj project ready for building! The python build script automatically will add each plugin to the xcodeproject.

The last thing I want to mention is the folder PartiallyCompiledProject. This is a special folder where you can put whatever you want to be included with the build. It’s most likely going to be useful for including a googleservices.json file if you end up using a firebase plugin.

All of what I’ve shown above is currently working great. My current focus is getting a Solar build.settings file to automatically add your native plugins into the custom App Maker build. Hopefully this means that for most of you, all you have to do is copy your build.settings file, run build-xcode-project.py, and then build!

Anyways, I hope to have the first version ready in the next month. There’s still a lot of work to do but this is very exciting to me. I can’t wait to do actual game development on my iPad!

1 Like

Another update: I’ve switch from YML to Lua for the config file. This means you can just directly copy in your plugins section of your existing Solar2D build.settings!

The file is now config.appmaker.lua. Here’s an example

--
-- For more information on config.appmaker.lua, see:
-- https://docs.appmakerios.com/#/customConfig
--
local spiralcodestudio_patreon_email = 'YOUR_EMAIL'
local spiralcodestudio_key = 'YOUR_ACCESS_KEY'

local function spiralcodestudio_plugin(name)
	local plugin = {publisherId = 'com.spiralcodestudio', supportedPlatforms = {}}
	local platforms = {'android', 'appletvos', 'appletvsimulator', 'iphone', 'iphone-sim', 'mac-sim', 'win32-sim'}
	for i = 1, #platforms do
		local platform = platforms[i]
		plugin.supportedPlatforms[platform] = {url = 'https://build.spiralcodestudio.com/' .. spiralcodestudio_patreon_email .. '/' .. spiralcodestudio_key .. '/solar2d/' .. name .. '_' .. platform .. '.tgz'}
	end
	return plugin
end

settings =
{
    --
    -- See the Plugin directory for all App Maker plugins.
    --
    appMakerPlugins =
    {
        ["GifPreviewer"] =
        {
            isLocal = true
        },
        ["GitProviders"] =
        {
            isLocal = true
        },
        ["MarkdownPreviewer"] =
        {
            isLocal = true
        },
        ["Solar2D"] =
        {
            isLocal = true
        },
        ["ZipExport"] =
        {
            isLocal = true
        },
    },

    --
    -- See http://plugins.solar2d.com for all a list of all Solar2D
    -- plugins. To add support for a Solar2D plugin in App Maker,
    -- make sure that you have included the Solar2D plugin in
    -- appMakerPlugins above.
    --
    solar2DPlugins =
    {
        ['plugin.nfc'] = spiralcodestudio_plugin('nfc'),
        ["plugin.example"] =
        {
            publisherId = "com.example"
        },
        ["plugin.example2"] =
        {
            publisherId = "com.example",
            marketplaceId = "asdf"
        },
        ["plugin.example23"] =
        {
            publisherId = "com.example",
            marketplaceId = "asdf",
            supportedPlatforms = {
                yo = false
            }
        },
    },


    --
    -- When you make a custom build of App Maker, you have the option of
    -- making one of your projects partially compiled. This is useful for
    -- doing things like adding a Firebase GoogleServices.json file or
    -- other things your app needs to have processed at compile-time. All
    -- you have to do is put files you wish to be compiled with App Maker
    -- into the folder "PartiallyCompiledProjects/{partially_compiled_project_to_include}".
    -- Everything will be compiled with your custom App Maker build. Note
    -- that due to the nature of the fact that we are compiling your project
    -- specific stuff at compile time WITH App Maker, what you put in in
    -- the folder will effect ALL projects, so be mindful of how this might
    -- affect things.
    --
    -- partiallyCompiledProjectFolder = "MyApp", -- i.e. PartiallyCompiledProjects/MyApp
}

A neat side effect is that plugin providers which use Lua functions as part of their setup work perfectly. i.e. Documentation Spiral Code Studio

I think I’m on track to have a version with native plugin support ready in 2 weeks.

Another update: It’s now downloading plugins! I just need it to have them link against the IDE and we’ll be on our way!

3 Likes

Yes, I disappeared for awhile. I had a lot of rework to do with the core of the IDE. Long story short, the Solar2D feature had to be put to the side for a minute.

But now I’m happy to say this Wednesday I’m going to publish the first beta version of the IDE with Solar2D! And I’m doing weekly updates from here on out too.

The repository is here. http://github.com/App-Maker-Software/AppMakerProfessional

The App Maker IDE is already published on this repo, but it only supports pure Lua projects. So you can give it a spin if you want to…or just wait until Wednesday for the Solar2D support :slight_smile:

5 Likes

Okay something really odd happened. The Lua binding used to read the config.lua and build.settings files is colliding with the Lua library embedded in CoronaCards. Long story short, I’m going to publish a version tomorrow without the plugin support and fix this symbol collision issue in an update.

Off to a rocky start…oh well :man_shrugging:

1 Like

Happy Saturday everyone!

So I finally fixed it. I had to learn a lot about symbol tables and C++ name mangling to get it working. If that’s interesting to anyone, here’s my two commits which got the IDE’s Lua source to not conflict with the Lua engine embedded in CoronaCards.

Might seem overkill, but this was needed to be able to do plugin resolution and other things.

So I’m going to post the 0.9.1 update on GitHub today. Hopefully future updates aren’t late like this one was!

1 Like