-
-
Notifications
You must be signed in to change notification settings - Fork 4
Home
-
Create a new repository for storing your extension's source files. You can make it Public or Private.
-
Create a folder called
src
(in GitHub or locally), and create another 2 folders according to your extension's package name. For example, if your extension's package name iscom.yusufcihan.maths
then your directory tree must be like this:
/src/com/yusufcihan/Maths/
- Lastly, add your Java source code to the inner folder.
If you created the folders in your computer, upload the src
folder with all subdirectories to the GitHub, you can do that by using drag-drop upload feature or with GitHub Desktop.
- Create a new GitHub actions file called
build.yml
in the/.github/workflows/
directory by typing.github/workflows/build.yml
in the file name text box. GitHub will automatically create directories for slashes.
- Now copy this snippet and paste to the your new
build.yml
file.
on: push
name: Build my extension
jobs:
buildAIX:
name: Build AIX
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Build AIX
id: build_aix
uses: ysfchn/appinventor-aix-action@master
with:
source: 'https://github.com/mit-cml/appinventor-sources.git'
- name: Upload Artifact
id: upload-artifact
uses: actions/[email protected]
with:
name: ${{ steps.build_aix.outputs.file }}
path: appinventor-sources/appinventor/components/build/extensions/${{ steps.build_aix.outputs.file }}
- Commit changes, and wait for your extension to compile. When build finished successfully, you need to go "Actions" tab in your repository, find Artifacts button and get the your .aix file.
Done!
If you want to add additional JAR libraries to your extension, you can follow this guide.
-
Fork mit-cml/appinventor-sources. Skip this step if you already forked App Inventor sources before.
-
Open
appinventor
>lib
folder. -
Create a folder in this directory (you can use the library name as folder name).
-
And upload JAR file in that folder.
Example:
- Go back to the parent directory, and open
components
>build.xml
file.
-
Edit the file and find
CopyComponentLibraries
section. -
Copy this code and append to the
CopyComponentLibraries
section.
<copy toFile="${public.deps.dir}/library.jar" file="${lib.dir}/folderName/library.jar" />
-
Replace
library
word with jar library's file name which you uploaded in step #4. (In this case, file name issocket.io-client-1.0.0.jar
) -
Replace
folderName
word with folder name which you created recently in step #3. (In this case, folder name issocketio
)
Example:
<copy toFile="${public.deps.dir}/socket.io-client-1.0.0.jar" file="${lib.dir}/socketio/socket.io-client-1.0.0.jar" />
-
Commit/save changes.
-
Go back to your
build.yml
file and replace App Inventor sources Git URL with your own fork's Git URL.
To use libraries in your extension;
-
Go back to your extension's Java source.
-
Add library file name (.jar) to
@UsesLibraries
section.
- Commit changes and you now have an extension which packaged with this .jar file! Note that library name must be same with .jar file which you uploaded in step #4.
That's it! If you have any other questions, you can create an Issue.