THRIFT-4750: as3 changes to build and publish to maven central
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 8e334d9..2c8ea50 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -28,7 +28,6 @@
 if(BUILD_COMPILER OR EXISTS ${THRIFT_COMPILER})
     set(HAVE_COMPILER ON)
 endif()
-CMAKE_DEPENDENT_OPTION(BUILD_EXAMPLES "Build examples" ON "HAVE_COMPILER" OFF)
 CMAKE_DEPENDENT_OPTION(BUILD_TESTING "Build with unit tests" ON "HAVE_COMPILER" OFF)
 CMAKE_DEPENDENT_OPTION(BUILD_TUTORIALS "Build Thrift tutorials" ON "HAVE_COMPILER" OFF)
 option(BUILD_LIBRARIES "Build Thrift libraries" ON)
@@ -45,6 +44,15 @@
     add_definitions(-DBOOST_TEST_DYN_LINK)
 endif()
 
+# as3
+option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON)
+if (WITH_AS3)
+    set(POSSIBLE_PATHS "${FLEX_HOME}/bin" "$ENV{FLEX_HOME}/bin")
+    find_program(HAVE_COMPC NAMES compc HINTS ${POSSIBLE_PATHS})
+endif ()
+CMAKE_DEPENDENT_OPTION(BUILD_AS3 "Build as3 library" ON
+                       "BUILD_LIBRARIES;WITH_AS3;HAVE_COMPC" OFF)
+
 # C++
 option(WITH_CPP "Build C++ Thrift library" ON)
 if(WITH_CPP)
@@ -82,10 +90,6 @@
 CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON
                        "BUILD_LIBRARIES;WITH_C_GLIB;GLIB_FOUND" OFF)
 
-	       #if(BUILD_C_GLIB AND BUILD_TESTING)
-	       #    find_package(Boost 1.53 REQUIRED)
-	       #endif()
-
 # Java
 option(WITH_JAVA "Build Java Thrift library" ON)
 if(ANDROID)
@@ -148,14 +152,15 @@
 if (UNIX)
     message(STATUS "  Build type:                                 ${CMAKE_BUILD_TYPE}")
 endif ()
-message(STATUS "  Build Thrift compiler:                      ${BUILD_COMPILER}")
+message(STATUS "  Build compiler:                             ${BUILD_COMPILER}")
 message(STATUS "  Build compiler plugin support:              ${WITH_PLUGIN}")
-message(STATUS "  Build with unit tests:                      ${BUILD_TESTING}")
+message(STATUS "  Build libraries:                            ${BUILD_LIBRARIES}")
+message(STATUS "  Build tests:                                ${BUILD_TESTING}")
 MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
-message(STATUS "  Build examples:                             ${BUILD_EXAMPLES}")
-MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
-message(STATUS "  Build Thrift libraries:                     ${BUILD_LIBRARIES}")
 message(STATUS " Language libraries:")
+message(STATUS "  Build as3 library:                          ${BUILD_AS3}")
+MESSAGE_DEP(WITH_AS3 "Disabled by WITH_AS3=OFF")
+MESSAGE_DEP(HAVE_COMPC "Adobe Flex compc was not found - did you set env var FLEX_HOME?")
 message(STATUS "  Build C++ library:                          ${BUILD_CPP}")
 MESSAGE_DEP(WITH_CPP "Disabled by WITH_CPP=OFF")
 message(STATUS "    C++ Language Level:                       ${CXX_LANGUAGE_LEVEL}")
diff --git a/build/docker/README.md b/build/docker/README.md
index 56b98a9..b65f74b 100644
--- a/build/docker/README.md
+++ b/build/docker/README.md
@@ -168,7 +168,7 @@
 | Language  | ubuntu-xenial | ubuntu-bionic | Notes |
 | :-------- | :------------ | :------------ | :---- |
 | as of     | Mar 06, 2018  | Jan 21, 2019  |       |
-| as3       |               |               | Not in CI |
+| as3       |               | 4.6.0         |       |
 | C++ gcc   | 5.4.0         | 7.3.0         |       |
 | C++ clang | 3.8           | 6.0           |       |
 | C# (mono) | 4.2.1.0       | 4.6.2.7       |       |
diff --git a/build/docker/ubuntu-bionic/Dockerfile b/build/docker/ubuntu-bionic/Dockerfile
index db19112..a75af31 100644
--- a/build/docker/ubuntu-bionic/Dockerfile
+++ b/build/docker/ubuntu-bionic/Dockerfile
@@ -71,10 +71,18 @@
       llvm \
       ninja-build \
       pkg-config \
+      unzip \
       valgrind \
       vim
 ENV PATH /usr/lib/llvm-6.0/bin:$PATH
 
+# lib/as3 (ActionScript)
+RUN mkdir -p /usr/local/adobe/flex/4.6 && \
+    cd /usr/local/adobe/flex/4.6 && \
+    wget -q "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip" && \
+    unzip flex_sdk_4.6.zip
+ENV FLEX_HOME /usr/local/adobe/flex/4.6
+
 RUN apt-get install -y --no-install-recommends \
 `# C++ dependencies` \
       libboost-all-dev \
diff --git a/build/veralign.sh b/build/veralign.sh
index c54de53..05039dc 100755
--- a/build/veralign.sh
+++ b/build/veralign.sh
@@ -56,6 +56,7 @@
 FILES[configure.ac]=configureReplace
 FILES[contrib/thrift.spec]=simpleReplace
 FILES[doc/specs/idl.md]=simpleReplace
+FILES[lib/as3/gradle.properties]=simpleReplace
 FILES[lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs]=simpleReplace
 FILES[lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj]=simpleReplace
 FILES[lib/csharp/src/Properties/AssemblyInfo.cs]=simpleReplace