Merge: Prepare Android projects to be compiled in release mode for F-Droid
authorJean Privat <jean@pryen.org>
Tue, 15 Sep 2015 13:27:16 +0000 (09:27 -0400)
committerJean Privat <jean@pryen.org>
Tue, 15 Sep 2015 13:27:16 +0000 (09:27 -0400)
This PR prepares the Android projects to be compiled in release mode by Jenkins (or a cron) for F-Droid. It adds the `android-release` rule to all Android projects and it vectorizes the fonts in the logos to get the desired result when the font is not installed.

At this point, the release APK file is written over the debug one, this should not be such a big problem as we usually use both separately.

@privat To prepare to compile in release mode on the server you can follow the instructions at the end of http://nitlanguage.org/catalog/android.html , it's pretty much a single command to generate a keystore. We'll have to find a way to manage the key to the keystore... For the TSA server, we could use http://tsa.safecreative.org/ but it's limited to 5 timestamps per days so we would need to choose our requests.

Pull-Request: #1710
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

contrib/crazy_moles/Makefile
contrib/friendz/Makefile
contrib/mnit_test/Makefile
contrib/tinks/Makefile
contrib/tinks/art/icon.svg
examples/calculator/art/icon.svg
examples/mnit_ballz/Makefile
examples/mnit_dino/Makefile
examples/shoot/Makefile

index 3fc90f7..049e851 100644 (file)
@@ -4,11 +4,14 @@ bin/moles: $(shell ../../bin/nitls -M src/moles_linux.nit) assets/images/drawing
        mkdir -p bin
        ../../bin/nitc -o bin/moles src/moles_linux.nit
 
+android: bin/moles.apk
 bin/moles.apk: android-icons $(shell ../../bin/nitls -M src/moles_android.nit) assets/images/drawing.png
        mkdir -p bin
        ../../bin/nitc -o bin/moles.apk src/moles_android.nit
 
-android: bin/moles.apk
+android-release: android-icons $(shell ../../bin/nitls -M src/moles_android.nit) assets/images/drawing.png
+       mkdir -p bin
+       ../../bin/nitc -o bin/moles.apk src/moles_android.nit --release
 
 ../inkscape_tools/bin/svg_to_icons:
        $(MAKE) -C ../inkscape_tools
index f236a1d..0cedb4c 100644 (file)
@@ -4,11 +4,18 @@ linux:
        mkdir -p bin
        ../../bin/nitc -o bin/friendz src/friendz_linux.nit
 
-android:
-       mkdir -p bin res
-       ../inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
+android: res/drawable-hdpi/icon.png
+       mkdir -p bin
        ../../bin/nitc -o bin/friendz.apk src/friendz_android.nit
 
+android-release: res/drawable-hdpi/icon.png
+       mkdir -p bin
+       ../../bin/nitc -o bin/friendz.apk src/friendz_android.nit --release
+
+res/drawable-hdpi/icon.png: art/icon.svg
+       mkdir -p res
+       ../inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
+
 doc:
        mkdir -p doc
        ../../bin/nitdoc -d doc/ src/friendz.nit src/friendz_linux.nit
index 73ed663..a198c27 100644 (file)
@@ -9,5 +9,10 @@ android:
        ../../bin/nitc -o bin/complete.apk src/complete_simple_android.nit --semi-global
        ../../bin/nitc -o bin/minimal.apk src/simple_android.nit --semi-global
 
+android-release:
+       mkdir -p bin
+       ../../bin/nitc -o bin/complete.apk src/complete_simple_android.nit --semi-global --release
+       ../../bin/nitc -o bin/minimal.apk src/simple_android.nit --semi-global --release
+
 clean:
        rm -rf bin
index b22453a..ee13360 100644 (file)
@@ -32,9 +32,12 @@ src/server/server_serialize.nit: $(shell ../../bin/nitls -M src/server/dedicated
        ../../bin/nitserial -o src/server/server_serialize.nit src/server/dedicated.nit
 
 # Android
+android: bin/tinks.apk
 bin/tinks.apk: assets/images/drawing.png src/client/client_serialize.nit res/drawable-ldpi/icon.png $(shell ../../bin/nitls -M src/client/android_client.nit)
-       ../../bin/nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit --compile-dir nit_compile
-       adb install -r bin/tinks.apk
+       ../../bin/nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit
+
+android-release: assets/images/drawing.png src/client/client_serialize.nit res/drawable-ldpi/icon.png $(shell ../../bin/nitls -M src/client/android_client.nit)
+       ../../bin/nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit --release
 
 res/drawable-ldpi/icon.png: art/icon.svg
        ../inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
index 20a590d..32229e4 100644 (file)
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
      inkscape:zoom="1.979899"
-     inkscape:cx="107.98668"
-     inkscape:cy="65.759563"
+     inkscape:cx="357.89925"
+     inkscape:cy="19.247995"
      inkscape:document-units="px"
      inkscape:current-layer="0splash"
      showgrid="false"
          transform="matrix(0.9571749,0,0,0.9571749,14.241487,126.08446)">
         <path
            style="font-size:52.50814056px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:-1px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Armalite Rifle;-inkscape-font-specification:Armalite Rifle"
-           d="m 258.625,595.8125 c -4.89966,1.4313 -12.56953,-1.70866 -15.1875,4.5625 -0.4775,5.90634 -3.5509,14.50575 2.71875,18.6875 2.28891,1.18746 5.12,1.54986 7.5625,0.59375 0.52227,3.72431 1.0541,7.99473 -2.03125,10.59375 -3.51238,6.69348 3.86364,14.87896 10.90625,12.96875 6.54546,1.2404 16.20527,-0.87285 16.34375,-9 1.15076,-4.65522 -4.58661,-6.69297 -3.46875,-11.1875 -0.95739,-2.94159 3.31489,-1.69978 4.46875,-3.78125 5.83868,-2.11249 5.55685,-9.07334 5.53125,-14.34375 1.81324,-6.47371 -5.8435,-9.85183 -11.15625,-8.5625 -4.34595,0.15294 -9.06169,-1.83389 -13.21875,-0.125 0.0516,-2.21144 -1.36209,-0.68823 -2.46875,-0.40625 z"
+           d="m 258.625,595.8125 c -4.89966,1.4313 -12.56953,-1.70866 -15.1875,4.5625 -0.4775,5.90634 -3.5509,14.50575 2.71875,18.6875 2.28891,1.18746 5.12,1.54986 7.5625,0.59375 0.52227,3.72431 1.0541,7.99473 -2.03125,10.59375 -3.51238,6.69348 3.86364,14.87896 10.90625,12.96875 6.54546,1.2404 16.20527,-0.87285 16.34375,-9 1.15076,-4.65522 0.20769,-5.09487 1.32555,-9.5894 -0.95739,-2.94159 -1.47941,-3.29788 -0.32555,-5.37935 5.83868,-2.11249 5.55685,-9.07334 5.53125,-14.34375 1.81324,-6.47371 -5.8435,-9.85183 -11.15625,-8.5625 -4.34595,0.15294 -9.06169,-1.83389 -13.21875,-0.125 0.0516,-2.21144 -1.36209,-0.68823 -2.46875,-0.40625 z"
            id="path3211"
-           inkscape:connector-curvature="0" />
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="ccccccccccccc" />
         <path
            style="font-size:52.50814056px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:-1px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Armalite Rifle;-inkscape-font-specification:Armalite Rifle"
            d="m 286.25,592.6875 c -2.39783,0.63195 -3.74457,2.90332 -6.59375,2.8125 -5.4632,2.29227 -6.35616,10.35289 -2.0625,14.25 -0.60542,4.15669 0.70607,8.39731 0.4375,12.3125 -0.0599,3.57375 -1.98208,6.31549 -3.3125,9.34375 -1.62554,5.38708 2.55698,12.80186 8.96875,10.96875 6.47834,0.22337 16.30714,2.49861 19.125,-5.53125 1.23942,-3.73894 -0.38135,-7.90712 -3.59375,-10.09375 0.3082,-5.37065 -0.71586,-11.3191 0.59375,-16.375 6.74005,-4.69817 1.76294,-18.17585 -6.625,-15.0625 -2.79844,0.69065 -4.06188,-3.31293 -6.9375,-2.625 z"
            inkscape:connector-curvature="0" />
         <path
            style="font-size:52.50814056px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:-1px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Armalite Rifle;-inkscape-font-specification:Armalite Rifle"
-           d="m 362.71875,595.53125 c -4.88629,0.1191 -10.06204,0.70685 -14.78125,0.75 -5.47787,-0.76679 -11.36437,-0.40783 -16.78125,-0.15625 -5.17104,2.08849 -5.75771,9.90066 -1.65625,13.3125 -0.73815,5.29915 0.55713,11.35287 -0.28125,16.21875 -1.57391,2.43976 0.0174,5.43494 -1.9375,7.65625 -1.21338,8.01052 8.60308,12.27891 15.15625,10.1875 4.10866,1.15111 8.03361,-0.96492 11.90625,0.75 4.70244,-0.0919 9.41322,-0.76127 13.9375,-1.21875 6.34357,-2.47232 7.27867,-12.62071 1.1875,-15.90625 -2.84504,-3.85906 -6.71699,-8.25024 -7.5,-12.8125 2.57537,-4.33547 10.38664,-3.74912 10.125,-10.0625 0.19504,-4.87459 -4.47645,-9.43549 -9.375,-8.71875 z"
+           d="m 362.71875,595.53125 c -4.88629,0.1191 -10.06204,0.70685 -14.78125,0.75 -5.47787,-0.76679 -11.36437,-0.40783 -16.78125,-0.15625 -5.17104,2.08849 -5.75771,9.90066 -1.65625,13.3125 -0.73815,5.29915 0.55713,11.35287 -0.28125,16.21875 -1.57391,2.43976 0.0174,5.43494 -1.9375,7.65625 -1.21338,8.01052 8.60308,12.27891 15.15625,10.1875 4.10866,1.15111 8.03361,-0.96492 11.90625,0.75 4.70244,-0.0919 9.41322,-0.76127 13.9375,-1.21875 6.34357,-2.47232 7.27867,-12.62071 1.1875,-15.90625 -2.84504,-3.85906 -3.69836,-8.25024 -4.48137,-12.8125 2.57537,-4.33547 7.36801,-3.74912 7.10637,-10.0625 0.19504,-4.87459 -4.47645,-9.43549 -9.375,-8.71875 z"
            id="path3217"
-           inkscape:connector-curvature="0" />
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="ccccccccccccc" />
         <path
            style="font-size:52.50814056px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:-1px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Armalite Rifle;-inkscape-font-specification:Armalite Rifle"
            d="m 387.9375,595.15625 c -4.67722,2.02978 -9.78906,-1.62403 -14.46875,1.25 -9.65979,4.02935 -13.06716,17.5954 -7.09375,25.71875 -5.60204,3.65765 -3.86108,11.71823 -2.5625,17.15625 1.89135,4.23664 7.4795,4.74734 11.125,3.125 3.94271,1.07416 7.9082,-0.0824 11.78125,1.1875 12.90654,0.16282 22.05847,-17.35307 13.34375,-27.46875 4.21701,-4.46396 3.58479,-12.34862 1.53125,-17.90625 -3.12179,-4.23683 -8.89538,-1.69513 -13.1875,-3.09375 l -0.46875,0.0312 z"
            inkscape:connector-curvature="0" />
         <path
            style="font-size:52.50814056px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:-1px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Armalite Rifle;-inkscape-font-specification:Armalite Rifle"
-           d="m 413.09375,593.625 c -5.989,0.79809 -12.31873,3.77439 -13.59375,10.28125 -2.37552,6.92367 2.58427,13.98287 3.0625,20.28125 -6.66505,6.69348 -1.32209,20.82556 8.75,19.25 7.10297,0.39661 12.84047,-7.75209 9.8125,-14.21875 0.3156,-2.89071 -3.70654,-4.76237 -1.46875,-7.53125 2.44848,-7.39695 6.24638,-18.36454 -1.53125,-23.75 -0.23875,-2.6484 -2.19852,-4.85675 -5.03125,-4.3125 z"
+           d="m 413.09375,593.625 c -5.989,0.79809 -12.31873,3.77439 -13.59375,10.28125 -2.77433,6.83505 1.00514,13.63195 3.0625,20.28125 -6.66505,6.69348 -1.32209,20.82556 8.75,19.25 7.10297,0.39661 12.84047,-7.75209 9.8125,-14.21875 0.3156,-2.89071 -3.70654,-4.76237 -1.46875,-7.53125 2.44848,-7.39695 6.24638,-18.36454 -1.53125,-23.75 -0.23875,-2.6484 -2.19852,-4.85675 -5.03125,-4.3125 z"
            id="path3221"
-           inkscape:connector-curvature="0" />
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cccccccc" />
       </g>
       <g
          style="stroke:#000000;stroke-width:3.85294461;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
            x="251.05626"
            id="tspan2996"
            sodipodi:role="line">TINKS!</tspan></text>
+      <text
+         xml:space="preserve"
+         style="font-size:50.25947571px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#e6e6e6;fill-opacity:1;stroke:none;font-family:Sans"
+         x="251.05626"
+         y="809.98505"
+         id="text3032"
+         sodipodi:linespacing="125%"><tspan
+           sodipodi:role="line"
+           id="tspan3034"
+           x="251.05626"
+           y="809.98505"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;letter-spacing:-0.9571749px;fill:#e6e6e6;fill-opacity:1;font-family:Armalite Rifle;-inkscape-font-specification:Armalite Rifle">TINKS!</tspan></text>
     </g>
   </g>
 </svg>
index ccd533c..618dc3d 100644 (file)
@@ -24,9 +24,9 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.9899495"
-     inkscape:cx="58.64005"
-     inkscape:cy="380.00465"
+     inkscape:zoom="1.4"
+     inkscape:cx="160.56125"
+     inkscape:cy="282.40083"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
        width="211.42856"
        id="rect2995"
        style="fill:#cccccc;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none" />
-    <text
-       xml:space="preserve"
+    <g
        style="font-size:269.1137085px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
-       x="299.74573"
-       y="770.06946"
-       id="text2997"
-       sodipodi:linespacing="125%"><tspan
-         sodipodi:role="line"
-         id="tspan2999"
-         x="299.74573"
-         y="770.06946">+</tspan></text>
+       id="text2997">
+      <path
+         d="m 364.00188,685.0516 -50.85303,0 0,-19.71047 50.85303,0 0,-51.11584 19.71048,0 0,51.11584 50.85303,0 0,19.71047 -50.85303,0 0,50.59023 -19.71048,0 0,-50.59023"
+         style=""
+         id="path2996" />
+    </g>
     <path
        inkscape:connector-curvature="0"
        id="path3018"
        id="path2997"
        style="font-size:202.30386353px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
        d="m 179.68975,735.88154 c -1e-5,-2.50244 0.32926,-4.60977 0.98782,-6.32199 0.65852,-1.77805 1.54755,-3.19391 2.66709,-4.2476 1.1195,-1.11949 2.43658,-1.90974 3.95125,-2.37074 1.51462,-0.52681 3.16097,-0.79023 4.93905,-0.79025 1.71218,2e-5 3.32561,0.26344 4.84028,0.79025 1.58047,0.461 2.93048,1.25125 4.05003,2.37074 1.11948,1.05369 2.00851,2.46955 2.66709,4.2476 0.65851,1.71222 0.98778,3.81955 0.98782,6.32199 -4e-5,2.43661 -0.32931,4.54394 -0.98782,6.322 -0.65858,1.71221 -1.54761,3.12807 -2.66709,4.24759 -1.11955,1.11952 -2.46956,1.94269 -4.05003,2.46953 -1.51467,0.52683 -3.1281,0.79024 -4.84028,0.79025 -1.77808,-10e-6 -3.42443,-0.26342 -4.93905,-0.79025 -1.51467,-0.52684 -2.83175,-1.35001 -3.95125,-2.46953 -1.11954,-1.11952 -2.00857,-2.53538 -2.66709,-4.24759 -0.65856,-1.77806 -0.98783,-3.88539 -0.98782,-6.322" />
-    <text
-       xml:space="preserve"
+    <g
        style="font-size:269.1137085px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
-       x="64.031456"
-       y="1006.8839"
-       id="text3013"
-       sodipodi:linespacing="125%"><tspan
-         sodipodi:role="line"
-         id="tspan3015"
-         x="64.031456"
-         y="1006.8839">=</tspan></text>
+       id="text3013">
+      <path
+         d="m 77.43458,894.9284 0,-19.57907 121.41654,0 0,19.57907 -121.41654,0 m 0,53.87531 0,-19.71048 121.41654,0 0,19.71048 -121.41654,0"
+         style=""
+         id="path2999" />
+    </g>
   </g>
 </svg>
index 4120b52..b9a0dfc 100644 (file)
@@ -7,6 +7,10 @@ android: icon
        mkdir -p bin
        ../../bin/nitc -o bin/ballz.apk src/ballz_android.nit
 
+android-release: icon
+       mkdir -p bin
+       ../../bin/nitc -o bin/ballz.apk src/ballz_android.nit --release
+
 linux:
        mkdir -p bin
        ../../bin/nitc -o bin/ballz src/ballz_linux.nit
index 42364bf..14faa98 100644 (file)
@@ -8,6 +8,10 @@ android: android-icons
        mkdir -p bin
        ../../bin/nitc -o bin/dino.apk src/dino_android.nit
 
+android-release: android-icons
+       mkdir -p bin
+       ../../bin/nitc -o bin/dino.apk src/dino_android.nit --release
+
 ../../contrib/inkscape_tools/bin/svg_to_icons:
        $(MAKE) -C ../../contrib/inkscape_tools
 
index 5e564d7..a42ffde 100644 (file)
@@ -8,6 +8,10 @@ android:
        mkdir -p bin
        ../../bin/nitc -o bin/shoot.apk src/shoot_android.nit
 
+android-release:
+       mkdir -p bin
+       ../../bin/nitc -o bin/shoot.apk src/shoot_android.nit --release
+
 null:
        mkdir -p bin
        ../../bin/nitc -o bin/shoot_null src/shoot_null.nit