@@ -186,22 +186,26 @@ def self.init
186186 sample_properties = "roxy/sample/build.sample.properties"
187187 sample_options = "roxy/sample/all.sample.xml"
188188 sample_rest_properties = "roxy/sample/properties.sample.xml"
189+ sample_app_config = "roxy/deploy/sample/custom-config.xqy"
189190 else
190- sample_config = ServerConfig . expand_path ( "#{ @@path } /sample/ml-config.sample.xml" )
191- sample_properties = ServerConfig . expand_path ( "#{ @@path } /sample/build.sample.properties" )
191+ sample_config = ServerConfig . expand_path ( "#{ @@path } /sample/ml-config.sample.xml" )
192+ sample_properties = ServerConfig . expand_path ( "#{ @@path } /sample/build.sample.properties" )
192193 sample_options = ServerConfig . expand_path ( "#{ @@path } /sample/all.sample.xml" )
193194 sample_rest_properties = ServerConfig . expand_path ( "#{ @@path } /sample/properties.sample.xml" )
195+ sample_app_config = ServerConfig . expand_path ( "#{ @@path } /sample/custom-config.xqy" )
194196 end
195197
196198 # output files
197199 build_properties = ServerConfig . expand_path ( "#{ @@path } /build.properties" )
198200 options_file = ServerConfig . expand_path ( "#{ @@path } /../rest-api/config/options/all.xml" )
199201 rest_properties = ServerConfig . expand_path ( "#{ @@path } /../rest-api/config/properties.xml" )
202+ app_config = ServerConfig . expand_path ( "#{ @@path } /../src/config/config.xqy" )
200203
201204 # dirs to create
202205 rest_ext_dir = ServerConfig . expand_path ( "#{ @@path } /../rest-api/ext" )
203206 rest_transforms_dir = ServerConfig . expand_path ( "#{ @@path } /../rest-api/transforms" )
204207 options_dir = ServerConfig . expand_path ( "#{ @@path } /../rest-api/config/options" )
208+ config_dir = ServerConfig . expand_path ( "#{ @@path } /../src/config" )
205209
206210 # get supplied options
207211 force = find_arg ( [ '--force' ] ) . present?
@@ -248,10 +252,6 @@ def self.init
248252 properties_file . gsub! ( /error-handler=\/ roxy\/ error.xqy/ , "error-handler=/MarkLogic/rest-api/error-handler.xqy" )
249253 end
250254
251- if app_type == "mvc"
252- properties_file . gsub! ( /application-conf-file=deploy\/ sample\/ custom-config.xqy/ , 'application-conf-file=src/app/config/config.xqy,deploy/sample/custom-config.xqy' )
253- end
254-
255255 # replace the text =random with a random string
256256 o = ( 33 ..126 ) . to_a
257257 properties_file . gsub! ( /=random/ ) do |match |
@@ -262,6 +262,10 @@ def self.init
262262 # Update properties file to set server-version to value specified on command-line
263263 properties_file . gsub! ( /server-version=6/ , "server-version=#{ server_version } " )
264264
265+ if [ "rest" , "bare" ] . include? app_type
266+ properties_file . gsub! ( /application-conf-file=src\/ app\/ config\/ config.xqy/ , 'application-conf-file=src/config/config.xqy' )
267+ end
268+
265269 # save the replacements
266270 open ( build_properties , 'w' ) { |f | f . write ( properties_file ) }
267271 end
@@ -275,6 +279,11 @@ def self.init
275279 copy_file sample_rest_properties , rest_properties
276280 end
277281
282+ if [ "rest" , "bare" ] . include? app_type
283+ FileUtils . mkdir_p config_dir
284+ copy_file sample_app_config , app_config
285+ end
286+
278287 target_config = ServerConfig . expand_path ( ServerConfig . properties [ "ml.config.file" ] )
279288
280289 if !force && !force_config && File . exists? ( target_config )
0 commit comments