Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix dependency on pa_monad

* Add 2 flags to oasis setup, to build conditionally tests and service
generator (depending on pa_monad)
* Update READMEs
  • Loading branch information...
commit 73bcb52d742b3ff43bece906c60994528dbe346c 1 parent fab84b6
Alessandro Strada authored
5 README.md
Source Rendered
@@ -78,8 +78,11 @@ doesn't have enough privileges)
78 78
79 79 $ ocaml setup.ml -install
80 80
81   -To run the tests, execute
  81 +To build and run the tests (you will need
  82 +[pa_monad](http://www.cas.mcmaster.ca/~carette/pa_monad/)), execute
82 83
  84 + $ ocaml setup.ml -configure --enable-tests
  85 + $ ocaml setup.ml -build
83 86 $ ocaml setup.ml -test
84 87
85 88 See [tests README](src/test/README.md) for further details regarding the tests.
15 _oasis
@@ -10,6 +10,16 @@ Homepage: https://github.com/astrada/gapi-ocaml
10 10 BuildTools: ocamlbuild
11 11 Plugins: META (0.2)
12 12
  13 +# Flags
  14 +Flag tests
  15 + Description: Build and run tests
  16 + Default: false
  17 +
  18 +# Flags
  19 +Flag generator
  20 + Description: Build service generator
  21 + Default: false
  22 +
13 23 # Libraries
14 24 Library gapi
15 25 Path: src/gapi
@@ -70,6 +80,7 @@ Document "gapi-ocaml"
70 80 Title: API reference for Google APIs client library
71 81 Type: ocamlbuild (0.2)
72 82 InstallDir: $htmldir/html
  83 + Install: false
73 84 DataFiles: doc/style.css
74 85 BuildTools: ocamldoc
75 86 XOCamlbuildPath: src
@@ -77,6 +88,7 @@ Document "gapi-ocaml"
77 88
78 89 # Executables
79 90 Executable serviceGenerator
  91 + Build$: flag(generator)
80 92 Path: tools
81 93 Install: false
82 94 MainIs: serviceGenerator.ml
@@ -103,18 +115,21 @@ Executable clientLoginFlow
103 115
104 116 # Tests
105 117 Executable refreshOAuth2Token
  118 + Build$: flag(tests)
106 119 Path: src/test
107 120 Install: false
108 121 MainIs: refreshOAuth2Token.ml
109 122 BuildDepends: gapi, oUnit
110 123
111 124 Executable testSuite
  125 + Build$: flag(tests)
112 126 Path: src/test
113 127 Install: false
114 128 MainIs: testSuite.ml
115 129 BuildDepends: gapi, gdata, oUnit
116 130
117 131 Test core
  132 + Run$: flag(tests)
118 133 Command: $testSuite
119 134 TestTools: testSuite
120 135
50 setup.ml
... ... @@ -1,7 +1,7 @@
1 1 (* setup.ml generated for the first time by OASIS v0.2.1~alpha1 *)
2 2
3 3 (* OASIS_START *)
4   -(* DO NOT EDIT (digest: 7d15d468afeeb2e4890a15e9793f08bb) *)
  4 +(* DO NOT EDIT (digest: 587c6d3542310688335996ad1916e87c) *)
5 5 (*
6 6 Regenerated by OASIS v0.2.1~alpha1
7 7 Visit http://oasis.forge.ocamlcore.org for more information and
@@ -5256,7 +5256,11 @@ let setup_t =
5256 5256 cs_plugin_data = [];
5257 5257 },
5258 5258 {
5259   - bs_build = [(OASISExpr.EBool true, true)];
  5259 + bs_build =
  5260 + [
  5261 + (OASISExpr.EBool true, false);
  5262 + (OASISExpr.EFlag "tests", true)
  5263 + ];
5260 5264 bs_install = [(OASISExpr.EBool true, false)];
5261 5265 bs_path = "src/test";
5262 5266 bs_compiled_object = Byte;
@@ -5310,7 +5314,11 @@ let setup_t =
5310 5314 post_command = [(OASISExpr.EBool true, None)];
5311 5315 };
5312 5316 test_working_directory = None;
5313   - test_run = [(OASISExpr.EBool true, true)];
  5317 + test_run =
  5318 + [
  5319 + (OASISExpr.EBool true, false);
  5320 + (OASISExpr.EFlag "tests", true)
  5321 + ];
5314 5322 test_tools =
5315 5323 [
5316 5324 ExternalTool "ocamlbuild";
@@ -5359,7 +5367,7 @@ let setup_t =
5359 5367 post_command = [(OASISExpr.EBool true, None)];
5360 5368 };
5361 5369 doc_build = [(OASISExpr.EBool true, true)];
5362   - doc_install = [(OASISExpr.EBool true, true)];
  5370 + doc_install = [(OASISExpr.EBool true, false)];
5363 5371 doc_install_dir = "$htmldir/html";
5364 5372 doc_title =
5365 5373 "API reference for Google APIs client library";
@@ -5370,6 +5378,16 @@ let setup_t =
5370 5378 doc_build_tools =
5371 5379 [ExternalTool "ocamlbuild"; ExternalTool "ocamldoc"];
5372 5380 });
  5381 + Flag
  5382 + ({
  5383 + cs_name = "tests";
  5384 + cs_data = PropList.Data.create ();
  5385 + cs_plugin_data = [];
  5386 + },
  5387 + {
  5388 + flag_description = Some "Build and run tests";
  5389 + flag_default = [(OASISExpr.EBool true, false)];
  5390 + });
5373 5391 Executable
5374 5392 ({
5375 5393 cs_name = "oauth2Flow";
@@ -5404,7 +5422,11 @@ let setup_t =
5404 5422 cs_plugin_data = [];
5405 5423 },
5406 5424 {
5407   - bs_build = [(OASISExpr.EBool true, true)];
  5425 + bs_build =
  5426 + [
  5427 + (OASISExpr.EBool true, false);
  5428 + (OASISExpr.EFlag "generator", true)
  5429 + ];
5408 5430 bs_install = [(OASISExpr.EBool true, false)];
5409 5431 bs_path = "tools";
5410 5432 bs_compiled_object = Byte;
@@ -5430,7 +5452,11 @@ let setup_t =
5430 5452 cs_plugin_data = [];
5431 5453 },
5432 5454 {
5433   - bs_build = [(OASISExpr.EBool true, true)];
  5455 + bs_build =
  5456 + [
  5457 + (OASISExpr.EBool true, false);
  5458 + (OASISExpr.EFlag "tests", true)
  5459 + ];
5434 5460 bs_install = [(OASISExpr.EBool true, false)];
5435 5461 bs_path = "src/test";
5436 5462 bs_compiled_object = Byte;
@@ -5479,7 +5505,17 @@ let setup_t =
5479 5505 bs_byteopt = [(OASISExpr.EBool true, [])];
5480 5506 bs_nativeopt = [(OASISExpr.EBool true, [])];
5481 5507 },
5482   - {exec_custom = false; exec_main_is = "oauth1Flow.ml"; })
  5508 + {exec_custom = false; exec_main_is = "oauth1Flow.ml"; });
  5509 + Flag
  5510 + ({
  5511 + cs_name = "generator";
  5512 + cs_data = PropList.Data.create ();
  5513 + cs_plugin_data = [];
  5514 + },
  5515 + {
  5516 + flag_description = Some "Build service generator";
  5517 + flag_default = [(OASISExpr.EBool true, false)];
  5518 + })
5483 5519 ];
5484 5520 plugins = [(`Extra, "META", Some "0.2")];
5485 5521 schema_data = PropList.Data.create ();
8 src/test/README.md
Source Rendered
@@ -111,9 +111,13 @@ Additional parameters:
111 111 Running the tests
112 112 -----------------
113 113
114   -By default, the test suite will run the tests that don't connect to Google
115   -services (and don't need the authorization configuration)
  114 +To build the tests you will need to install
  115 +[pa_monad](http://www.cas.mcmaster.ca/~carette/pa_monad/)). By default, the
  116 +test suite will run the tests that don't connect to Google services (and don't
  117 +need the authorization configuration)
116 118
  119 + $ ocaml setup.ml -configure --enable-tests
  120 + $ ocaml setup.ml -build
117 121 $ ocaml setup.ml -test
118 122
119 123 To test the interaction with the remote services, you can use the `-service`
5 src/test/_tags
... ... @@ -1,8 +1,3 @@
1 1 # Packages deps
2   -<testHelper.*> : pkg_extlib, pkg_json-wheel
3 2 <testMonadic.*> : pkg_monad, syntax_camlp4o
4   -<testDate.*> : pkg_netstring
5   -<test*Model.*> : pkg_extlib, pkg_json-wheel
6   -<test*Service.*> : pkg_extlib, pkg_json-wheel
7   -<test*.*> : pkg_oUnit
8 3
9 tools/README.md
Source Rendered
@@ -19,6 +19,15 @@ files:
19 19 These files should be linked with the `gapi` library that provides the basic
20 20 functionalities to query the Google RESTful services.
21 21
  22 +### Compiling
  23 +
  24 +To build the generator you will need
  25 +[pa_monad](http://www.cas.mcmaster.ca/~carette/pa_monad/)). After installing
  26 +it, execute
  27 +
  28 + $ ocaml setup.ml -configure --enable-generator
  29 + $ ocaml setup.ml -build
  30 +
22 31 ### Example
23 32
24 33 This command will generate the source code of the client for the URL shortener

0 comments on commit 73bcb52

Please sign in to comment.
Something went wrong with that request. Please try again.