npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

extensions.unity.ubuilder

v1.2.0

Published

Helpful function to call from command line to create a build from Unity project.

Downloads

17

Readme

UBuilder - Unity command line builder

npm openupm License Stand With Ukraine

Unity command line builder. Flexible setup through Environment variables in combination with command line variables. Well combined with Fastlane.

All operation systems are supported for running the build process:

  • :white_check_mark: Windows
  • :white_check_mark: MacOS
  • :white_check_mark: Linux

Supported platforms:

  • :white_check_mark: Standalone (Windows / Mac / Linux)
  • :white_check_mark: iOS
  • :white_check_mark: Android
  • :yellow_circle: other (supported but not tested)

How to install - Option 1 (RECOMMENDED)

  • Install OpenUPM-CLI
  • Open command line in Unity project folder
  • openupm add extensions.unity.ubuilder

How to install - Option 2

  • Add this code to /Packages/manifest.json
{
  "dependencies": {
    "extensions.unity.ubuilder": "1.2.0",
  },
  "scopedRegistries": [
    {
      "name": "Unity Extensions",
      "url": "https://registry.npmjs.org",
      "scopes": [
        "extensions.unity"
      ]
    }
  ]
}

Variables

Any variable can be passed as argument in command line such as output=./Builds/Destination or it could be set as environment variable in command line or in operation system or even in docker. In command line you can do this by this command

SET output=./Builds/Destination on Windows

output=./Builds/Destination on MacOS and Linux

Global variables

| Variable | Type | Default | Description | | ------------------ | ------- | --------------- | ------------------------------------------------------------------------------------------------- | | output | string | null | absolute or relevant path to build destination | | buildNumber | integer | timestamp | integer value of build number | | buildVersion | string | current version | build version, should contains only numbers and dots, last and first characters should be numbers | | developmentBuild | boolean | current value | true/false, enable or disable Unity project flag - Development Build |

iOS related variables

| Variable | Type | Default | Description | | ---------------------------- | ------- | ------------- | ----------------------------------- | | ios_SigningTeamId | string | current value | Apple signing team ID | | ios_EnableAutomaticSigning | boolean | current value | true/false, automatic signing build |

Android related variables

| Variable | Type | Default | Description | | --------------------------- | ------- | ------------- | -------------------------------------------------------------------------- | | android_BUILD_APP_BUNDLE | string | current value | true/false, true - compile .aab file for Google Play, false - compile .apk | | android_KEYSTORE_PATH | boolean | null | [required] path to keystore | | android_KEYSTORE_PASSWORD | boolean | null | [required] keystore password | | android_KEYALIAS_NAME | boolean | null | [required] key alias | | android_KEYALIAS_PASSWORD | boolean | null | [required] key alias password |

How to use in command line (MacOS & Linux)

Tip: If you don't have Unity Pro license that allow you to run Unity in batchmode (no GUI), you can use Unity Personal license. In this case you should run Unity Editor with GUI and it will build project. Just need to remove -batchmode -nographics from command line.

iOS

UnityEditor=/Applications/"Unity Editor"/2019.2.1f1/Unity.app/Contents/MacOS/Unity
"$UnityEditor" -projectPath ./ -logFile build.log -executeMethod UBuilder.CommandiOS.Build -quit -accept-apiupdate -quitTimeout 6000 -batchmode -nographics

Android

UnityEditor=/Applications/"Unity Editor"/2019.2.1f1/Unity.app/Contents/MacOS/Unity
android_KEYSTORE_PATH=***************
android_KEYSTORE_PASSWORD=***************
android_KEYALIAS_NAME=***************
android_KEYALIAS_PASSWORD=***************

"$UnityEditor" -projectPath ./ -logFile build.log -executeMethod UBuilder.CommandAndroid.Build -quit -accept-apiupdate -quitTimeout 6000 -batchmode -nographics

Other

UnityEditor=/Applications/"Unity Editor"/2019.2.1f1/Unity.app/Contents/MacOS/Unity
"$UnityEditor" -projectPath ./ -logFile build.log -executeMethod UBuilder.Command.Build -quit -accept-apiupdate -quitTimeout 6000 -batchmode -nographics

Or create .sh file and put the text inside. Ease way to start build process by single script.

How to use in command line (Windows)

Android

SET UnityEditor=C:/UnityEditor/Unity/2019.2.1f1/Editor/Unity.exe
SET android_BUILD_APP_BUNDLE=false
SET android_KEYSTORE_PATH=***************
SET android_KEYSTORE_PASSWORD=***************
SET android_KEYALIAS_NAME=***************
SET android_KEYALIAS_PASSWORD=***************

%UnityEditor% -projectPath ./ -logFile build.log -executeMethod UBuilder.CommandAndroid.Build -quit -accept-apiupdate -quitTimeout 6000 -batchmode -nographics

Other

SET UnityEditor=C:/UnityEditor/Unity/2019.2.1f1/Editor/Unity.exe
%UnityEditor% -projectPath ./ -logFile build.log -executeMethod UBuilder.Command.Build -quit -accept-apiupdate -quitTimeout 6000 -batchmode -nographics

Or create .bat file and put the text inside. Double click the bat file. Ease way to start build process by single script

Hot to use in code (any OS)

| Function | Description | | ---------------------------------- | ------------------------------------------------------------------------------------------- | | UBuilder.CommandiOS.Build() | create XCode project (MacOS required) | | UBuilder.CommandAndroid.Build() | create APK (android_BUILD_APP_BUNDLE=false) or AAB (android_BUILD_APP_BUNDLE=true) file | | UBuilder.CommandAndroid.Export() | create Android Studio project | | UBuilder.Command.Build() | build current (from ProjectSettings) platform build |

How to use in Unity Editor (codeless)

Press File/UBuilder and choose needed build options from the list.

Build Options

Customize project before build

Before execute the UBuilder functions, prepare a project to build. You can do that by creating public static class with public static method. In that method you should prepare your project and call needed UBuilder function. In command line call your new public static function instead of UBuilder function. Example:

public static class ProjectBuilder
{
    // customize package name (bundle id)
    [MenuItem("File/UBuilder/Build Android custom package")]
    public static void BuildiOSCustomPackage()
    {
        PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "my.project.game");
        UBuilder.CommandiOS.Build();
    }
    
    // customize package name (bundle id)
    [MenuItem("File/UBuilder/Build Android+iOS custom package")]
    public static void BuildiOSAndroidCustomPackage()
    {
        PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "my.project.game");
        PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "my.project.game");
        UBuilder.CommandiOS.Build();
        UBuilder.CommandAndroid.Build();
    }
}
SET UnityEditor=C:/UnityEditor/Unity/2019.2.1f1/Editor/Unity.exe
%UnityEditor% -projectPath ./.. -logFile build.log -executeMethod BuildProject.BuildiOSCustomPackage -quit -accept-apiupdate -quitTimeout 6000 -batchmode -nographics output=Builds/iOS_Custom_Package