Mit Ai2 Companion

This code is designed khổng lồ be run in Google"s App Engine. MIT runs apublic instance that all are welcome lớn use to build App InventorApplications. You vì chưng not need lớn compile or use this code if you wishto lớn build MIT App Inventor applications.

Bạn đang xem: Mit ai2 companion

We provide this code for reference & for experienced people who wishlớn operate their own App Inventor instance and/or contribute lớn the project.

This code is tested và known khổng lồ work with Java 8.

Contributors

The best way to lớn go about integrating changes in App Inventor is khổng lồ start a conversation in the xuất hiện Source forum about whatever you intkết thúc to lớn change or add.

We use very brief and informal thiết kế documents with descriptions of the proposed changes và screenshots of how the functionality would look lượt thích and behave sầu, in order to lớn gather as much feedbaông chồng from the community, as early as possible. We generally use shared Google docs for this (with permissions khổng lồ add comments), but any format that is accessible from a web browser (& allows comments) would vì chưng.

If you have sầu skipped this step and have sầu gone ahead & made your changes already, feel miễn phí lớn open a pull request, but don"t be too surprised if we ask you khổng lồ go bachồng and document it in a thiết kế document. Rethành viên that the main goal of doing this is to lớn gather as much feedbaông xã, as early as possible. We will also possibly ask you lớn put an instance with your changes on appspot, and provide a modified Companion tiện ích (if that applies) so that reviewers can play with the changes before looking at the source.

Cheông chồng out our open source site to find a lot more information about the project và how to lớn contribute lớn it.

Setup instructions (Vagrant)

The easiest way lớn get a development environment up & running is to use the provided Vagranttệp tin. Install Vagrant and open a terminal in the root directory of this repository. Run the following commands


vagrant plugin install vagrant-vbguest # optionally for virtualbox users, và only oncevagrant up # initializes the VM
It may take a few minutes for Vagrant to initialize as it will pull down a virtual machine image from the Internet & configure it with all of the App Inventor dependencies. Subsequent start-ups will be faster. Next, enter the virtual machine by running:


vagrant ssh
This should open up a terminal within the virtual machine in the directory /vagrant/appinventor. This directory is the same as the appinventor directory in this repository, shared between your host machine & the virtual machine. Any changes made on one side will be visible in the other. This allows you khổng lồ edit files on your host machine with your preferred editor, while keeping the build environment relegated to the virtual machine. To build App Inventor, you may now run:


ant
and lớn run App Inventor:


start_appinventor
Press Ctrl+C khổng lồ quit the hệ thống. Enter exit at the prompt to lớn leave sầu the virtual machine. To reclalặng resources when you are not actively developing, you can run vagrant halt lớn stop the virtual machine. To completely remove sầu the virtual machine, run vagrant destroy. If you destroy the VM, you will need khổng lồ start these instructions from the top.

cảnh báo 1: For macOS users, if you are using VirtualBox & get any error while initializing the VM it may be due to security restrictions in System Preferences, consider reading this article.

lưu ý 2: If it seems like none of the dependencies are installed in the VM, run vagrant provision.

For better performance, consider using the manual instructions.

Setup instructions (manual)

This is a quichồng guide khổng lồ get started with the sources. More detailed instructions can be found here, a slide show can be seen here, and all the documentation for the project is available in our site.

Dependencies

You will need a full Java JDK (version 8, OpenJDK preferred; JRE is not enough) và Python thả to lớn compile and run the servers.

You will also need a copy of the Google Cloud SDK for Java và ant.

Xem thêm: Từ Vựng Tiếng Anh Về Các Loại Thịt Cừu Tiếng Anh Về Các Loại Thịt

If you want to make changes to the source, you are going lớn need to run an automated test suite, và for that you will also need phantomjs. Have sầu a look at the testing section for more information.

chú ý 1: If you are working on a 64-bit linux system, you need khổng lồ install 32-bit version of: glibc(lớn get a 32-bit version of ld-linux.so), zlib & libstdc++.

If you are on a Debian-based distribution(Ubuntu), use:


$ suvì chưng apt-get install libc6:i386 zlib1g:i386 libstdc++6:i386
If you are on an RPM-based distribution(Fedora), use:


$ suvì chưng dnf install glibc.i686 zlib.i686 libstdc++.i686
chú ý 2: Certain Java 8 features, such as lambdomain authority expressions, are not supported on Android, so please don"t use them in your changes lớn the source code.

Forking or cloning

Consider forking the project if you want khổng lồ make changes to the sources. If you simply want khổng lồ run it locally, you can simply clone it.

ForkingIf you decide to fork, follow the instructions given by gamesbaidoithuong.com. After that you can clone your own copy of the sources with:


$ git clone https://gamesbaidoithuong.com/YOUR_USER_NAME/appinventor-sources.git
Make sure you change YOUR_USER_NAME khổng lồ your user name.

Configuring a remote pointing to this repository is also a good idea if you are forking:


$ cd appinventor-sources$ git remote add upstream https://gamesbaidoithuong.com/mit-cml/appinventor-sources.git
Finally, you will also have sầu khổng lồ make sure that you are ignoring files that need ignoring:


$ cp sample-.gitignore .gitignore

Checkout dependencies

App Inventor uses Blockly, the web-based visual programming editor from Google, as a core part of its editor. Blockly core is made available lớn App Inventor as a git submodule. The first time after forking or cloning the repository, you will need lớn persize the following commands:


$ git submodule update --init
For developers who will be working on Blockly within the context of App Inventor, the preferred checkout procedure is khổng lồ persize a git submodule init, edit the .git/config tệp tin to lớn use the read/write SSH URL for MIT CML"s Blockly fork instead of the public read-only HTTPS URL assumed by mặc định (to lớn tư vấn pushing changes). After changing .git/config, a git submodule update will pull the repository.

If you need to switch baông chồng to a branch that does contains the Blockly và Closure Library sources in the tree, you will need to run the command:


$ git submodule deinit --all
to clear out the submodules before switching branches. When switching back, you will need lớn repeat the initialization & update procedure above.

Troubleshooting common installation issues

Run this command khổng lồ run a self-diagnosis of your environment. This command tries khổng lồ figure out comtháng installation issues & offers you a solution to fix them yourself. Make sure this passes all the checks before you proceed further.

Linux & macOS
./buildtools doctor
Windows
buildtools doctor

Compiling

Before compiling the code, an auth key is needed. You can create one by running the following commands:


$ cd appinventor$ ant MakeAuthKey
Once the key is in place, type the following khổng lồ compile (from the appinventor folder):


$ ant
You will see a lot of stuff in the terminal and after a few minutes (it can take from 2 khổng lồ 10 minutes, depending on your machine specs) you should see a message saying something like Build Successful.

Running the server(s)

There are two servers in App Inventor, the main VPS that đơn hàng with project information, và the build server that creates game android files. More detailed information can be found in the App Inventor Developer Overview document.

Running the main server
$ your-google-cloud-SDK-folder/bin/java_dev_apphệ thống.sh --port=8888 --address=0.0.0.0 appengine/build/war/
Make sure you change your-google-cloud-SDK-folder lớn wherever in your hard drive sầu you have sầu placed the Google Cloud SDK.

Running the build serverThe build hệ thống can be run from the terminal by typing:


$ cd appinventor/buildserver$ ant RunLocalBuildServer
Note that you will only need khổng lồ run the build VPS if you are going khổng lồ build an phầm mềm as an android. You can vì chưng all the layout & programming without having the build server running, but you will need it to tải về the android.

Accessing your local server

You should now be up và running; you can kiểm tra this by pointing your browser to:


http://localhost:8888
Before entering or scanning the QR code in the Companion, check the box labeled "Use Legacy Connection".

Running tests

The automated tests depkết thúc on Phantomjs. Make sure you install it và add it to your path. After that, you can run all tests by typing the following in a terminal window:


$ ant tests

Building Release Code

Release builds with optimizations turned on for the website components of the system can be done by passing -Drelease=true lớn ant, e.g.: