From a78aa521b333de2fbbd533d98b33b83c0a1d40f2 Mon Sep 17 00:00:00 2001 From: Christian Guenter Date: Mon, 24 Sep 2018 13:04:23 +0200 Subject: [PATCH] DDLX: Serialzie source code in .asddls file Before this commit is applied DDLX source code was recorded in the xml file. We changed this so that now a separte .asddls file is created. The change is downward compatible. Previously recorded DDLX objects will show a diff the next time and the new .asddls file has to be committed. --- src/objects/zcl_abapgit_object_ddlx.clas.abap | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/objects/zcl_abapgit_object_ddlx.clas.abap b/src/objects/zcl_abapgit_object_ddlx.clas.abap index 2802671a2..6d96f3f10 100644 --- a/src/objects/zcl_abapgit_object_ddlx.clas.abap +++ b/src/objects/zcl_abapgit_object_ddlx.clas.abap @@ -138,7 +138,8 @@ CLASS zcl_abapgit_object_ddlx IMPLEMENTATION. lv_text TYPE string, lx_error TYPE REF TO cx_root. - FIELD-SYMBOLS: TYPE any. + FIELD-SYMBOLS: TYPE any, + TYPE data. TRY. CREATE DATA lr_data @@ -151,6 +152,16 @@ CLASS zcl_abapgit_object_ddlx IMPLEMENTATION. CHANGING cg_data = ). + ASSIGN COMPONENT 'CONTENT-SOURCE' OF STRUCTURE TO . + ASSERT sy-subrc = 0. + + TRY. + " If the file doesn't exist that's ok, because previously + " the source code was stored in the xml. We are downward compatible. + = mo_files->read_string( 'asddlxs' ) ##no_text. + CATCH zcx_abapgit_exception. + ENDTRY. + CREATE OBJECT li_data_model TYPE ('CL_DDLX_WB_OBJECT_DATA'). @@ -219,7 +230,8 @@ CLASS zcl_abapgit_object_ddlx IMPLEMENTATION. lv_text TYPE string, lx_error TYPE REF TO cx_root. - FIELD-SYMBOLS: TYPE any. + FIELD-SYMBOLS: TYPE any, + TYPE data. lv_object_key = ms_item-obj_name. @@ -245,6 +257,14 @@ CLASS zcl_abapgit_object_ddlx IMPLEMENTATION. clear_fields( CHANGING cs_data = ). + ASSIGN COMPONENT 'CONTENT-SOURCE' OF STRUCTURE TO . + ASSERT sy-subrc = 0. + + mo_files->add_string( iv_ext = 'asddlxs' + iv_string = ). + + CLEAR . + io_xml->add( iv_name = 'DDLX' ig_data = ).