Merge lp:~zeller-benjamin/ubuntu-sdk-ide/snapcraft-step2 into lp:ubuntu-sdk-ide
- snapcraft-step2
- Merge into trunk
Proposed by
Benjamin Zeller
Status: | Merged |
---|---|
Approved by: | Zoltan Balogh |
Approved revision: | 165 |
Merged at revision: | 164 |
Proposed branch: | lp:~zeller-benjamin/ubuntu-sdk-ide/snapcraft-step2 |
Merge into: | lp:ubuntu-sdk-ide |
Diff against target: |
303842 lines (+301319/-81) 446 files modified
CMakeLists.txt (+29/-2) dist/qtcreator/src/plugins/ubuntu/UbuntuPlugin.pro (+2/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName.pro (+0/-32) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.desktop (+0/-9) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.pro (+2/-19) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.desktop (+9/-0) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/snapcraft.yaml (+10/-4) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/wizard.json (+7/-12) dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/scripts/run_snapcraft.py (+29/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/UbuntuProject.mimetypes.xml (+5/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfiguration.cpp (+41/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfiguration.h (+33/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfigurationfactory.cpp (+145/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfigurationfactory.h (+44/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildstepfactory.cpp (+65/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildstepfactory.h (+25/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftproject.cpp (+156/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftproject.h (+88/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectfile.cpp (+42/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectfile.h (+48/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectmanager.cpp (+64/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectmanager.h (+40/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp (+496/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.h (+136/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftrsyncstep.cpp (+51/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftrsyncstep.h (+31/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftstep.cpp (+67/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftstep.h (+33/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings/snapcraftkitinformation.cpp (+114/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings/snapcraftkitinformation.h (+59/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snap.pri (+27/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuclicktool.cpp (+5/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuclicktool.h (+1/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuconstants.h (+10/-0) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntukitmanager.cpp (+4/-1) dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp (+14/-2) dist/yaml-cpp/.clang-format (+47/-0) dist/yaml-cpp/.hgeol (+4/-0) dist/yaml-cpp/.hgignore (+1/-0) dist/yaml-cpp/.pc/.quilt_patches (+1/-0) dist/yaml-cpp/.pc/.quilt_series (+1/-0) dist/yaml-cpp/.pc/.version (+1/-0) dist/yaml-cpp/.pc/applied-patches (+2/-0) dist/yaml-cpp/.pc/install-cmake-dev-files.patch/CMakeLists.txt (+340/-0) dist/yaml-cpp/.pc/pkgconfig.patch/yaml-cpp.pc.cmake (+11/-0) dist/yaml-cpp/CMakeLists.txt (+356/-0) dist/yaml-cpp/debian/changelog (+56/-0) dist/yaml-cpp/debian/compat (+1/-0) dist/yaml-cpp/debian/control (+39/-0) dist/yaml-cpp/debian/copyright (+44/-0) dist/yaml-cpp/debian/libyaml-cpp-dev.install (+5/-0) dist/yaml-cpp/debian/libyaml-cpp0.5v5.install (+1/-0) dist/yaml-cpp/debian/patches/install-cmake-dev-files.patch (+69/-0) dist/yaml-cpp/debian/patches/pkgconfig.patch (+19/-0) dist/yaml-cpp/debian/patches/series (+2/-0) dist/yaml-cpp/debian/rules (+64/-0) dist/yaml-cpp/debian/source/format (+1/-0) dist/yaml-cpp/debian/watch (+3/-0) dist/yaml-cpp/include/yaml-cpp/anchor.h (+17/-0) dist/yaml-cpp/include/yaml-cpp/binary.h (+67/-0) dist/yaml-cpp/include/yaml-cpp/contrib/anchordict.h (+37/-0) dist/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h (+147/-0) dist/yaml-cpp/include/yaml-cpp/dll.h (+37/-0) dist/yaml-cpp/include/yaml-cpp/emitfromevents.h (+57/-0) dist/yaml-cpp/include/yaml-cpp/emitter.h (+254/-0) dist/yaml-cpp/include/yaml-cpp/emitterdef.h (+16/-0) dist/yaml-cpp/include/yaml-cpp/emittermanip.h (+137/-0) dist/yaml-cpp/include/yaml-cpp/emitterstyle.h (+16/-0) dist/yaml-cpp/include/yaml-cpp/eventhandler.h (+40/-0) dist/yaml-cpp/include/yaml-cpp/exceptions.h (+227/-0) dist/yaml-cpp/include/yaml-cpp/mark.h (+27/-0) dist/yaml-cpp/include/yaml-cpp/node/convert.h (+286/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h (+26/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/impl.h (+177/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/iterator.h (+65/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/iterator_fwd.h (+28/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/memory.h (+48/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/node.h (+165/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/node_data.h (+124/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/node_iterator.h (+159/-0) dist/yaml-cpp/include/yaml-cpp/node/detail/node_ref.h (+95/-0) dist/yaml-cpp/include/yaml-cpp/node/emit.h (+25/-0) dist/yaml-cpp/include/yaml-cpp/node/impl.h (+441/-0) dist/yaml-cpp/include/yaml-cpp/node/iterator.h (+31/-0) dist/yaml-cpp/include/yaml-cpp/node/node.h (+143/-0) dist/yaml-cpp/include/yaml-cpp/node/parse.h (+30/-0) dist/yaml-cpp/include/yaml-cpp/node/ptr.h (+29/-0) dist/yaml-cpp/include/yaml-cpp/node/type.h (+16/-0) dist/yaml-cpp/include/yaml-cpp/noncopyable.h (+25/-0) dist/yaml-cpp/include/yaml-cpp/null.h (+24/-0) dist/yaml-cpp/include/yaml-cpp/ostream_wrapper.h (+72/-0) dist/yaml-cpp/include/yaml-cpp/parser.h (+48/-0) dist/yaml-cpp/include/yaml-cpp/stlemitter.h (+51/-0) dist/yaml-cpp/include/yaml-cpp/traits.h (+103/-0) dist/yaml-cpp/include/yaml-cpp/yaml.h (+24/-0) dist/yaml-cpp/install.txt (+24/-0) dist/yaml-cpp/license.txt (+19/-0) dist/yaml-cpp/src/binary.cpp (+93/-0) dist/yaml-cpp/src/collectionstack.h (+39/-0) dist/yaml-cpp/src/contrib/graphbuilder.cpp (+17/-0) dist/yaml-cpp/src/contrib/graphbuilderadapter.cpp (+94/-0) dist/yaml-cpp/src/contrib/graphbuilderadapter.h (+79/-0) dist/yaml-cpp/src/convert.cpp (+75/-0) dist/yaml-cpp/src/directives.cpp (+22/-0) dist/yaml-cpp/src/directives.h (+29/-0) dist/yaml-cpp/src/emit.cpp (+25/-0) dist/yaml-cpp/src/emitfromevents.cpp (+119/-0) dist/yaml-cpp/src/emitter.cpp (+911/-0) dist/yaml-cpp/src/emitterstate.cpp (+350/-0) dist/yaml-cpp/src/emitterstate.h (+203/-0) dist/yaml-cpp/src/emitterutils.cpp (+482/-0) dist/yaml-cpp/src/emitterutils.h (+50/-0) dist/yaml-cpp/src/exp.cpp (+136/-0) dist/yaml-cpp/src/exp.h (+209/-0) dist/yaml-cpp/src/indentation.h (+41/-0) dist/yaml-cpp/src/memory.cpp (+26/-0) dist/yaml-cpp/src/node.cpp (+12/-0) dist/yaml-cpp/src/node_data.cpp (+296/-0) dist/yaml-cpp/src/nodebuilder.cpp (+130/-0) dist/yaml-cpp/src/nodebuilder.h (+70/-0) dist/yaml-cpp/src/nodeevents.cpp (+101/-0) dist/yaml-cpp/src/nodeevents.h (+64/-0) dist/yaml-cpp/src/null.cpp (+5/-0) dist/yaml-cpp/src/ostream_wrapper.cpp (+57/-0) dist/yaml-cpp/src/parse.cpp (+68/-0) dist/yaml-cpp/src/parser.cpp (+128/-0) dist/yaml-cpp/src/ptr_stack.h (+53/-0) dist/yaml-cpp/src/ptr_vector.h (+49/-0) dist/yaml-cpp/src/regex_yaml.cpp (+45/-0) dist/yaml-cpp/src/regex_yaml.h (+85/-0) dist/yaml-cpp/src/regeximpl.h (+186/-0) dist/yaml-cpp/src/scanner.cpp (+386/-0) dist/yaml-cpp/src/scanner.h (+135/-0) dist/yaml-cpp/src/scanscalar.cpp (+221/-0) dist/yaml-cpp/src/scanscalar.h (+61/-0) dist/yaml-cpp/src/scantag.cpp (+81/-0) dist/yaml-cpp/src/scantag.h (+19/-0) dist/yaml-cpp/src/scantoken.cpp (+436/-0) dist/yaml-cpp/src/setting.h (+99/-0) dist/yaml-cpp/src/simplekey.cpp (+128/-0) dist/yaml-cpp/src/singledocparser.cpp (+413/-0) dist/yaml-cpp/src/singledocparser.h (+65/-0) dist/yaml-cpp/src/stream.cpp (+448/-0) dist/yaml-cpp/src/stream.h (+76/-0) dist/yaml-cpp/src/streamcharsource.h (+48/-0) dist/yaml-cpp/src/stringsource.h (+48/-0) dist/yaml-cpp/src/tag.cpp (+49/-0) dist/yaml-cpp/src/tag.h (+33/-0) dist/yaml-cpp/src/token.h (+69/-0) dist/yaml-cpp/test/CMakeLists.txt (+34/-0) dist/yaml-cpp/test/create-emitter-tests.py (+211/-0) dist/yaml-cpp/test/gmock-1.7.0/CHANGES (+126/-0) dist/yaml-cpp/test/gmock-1.7.0/CMakeLists.txt (+171/-0) dist/yaml-cpp/test/gmock-1.7.0/CONTRIBUTORS (+40/-0) dist/yaml-cpp/test/gmock-1.7.0/LICENSE (+28/-0) dist/yaml-cpp/test/gmock-1.7.0/Makefile.am (+216/-0) dist/yaml-cpp/test/gmock-1.7.0/Makefile.in (+1357/-0) dist/yaml-cpp/test/gmock-1.7.0/README (+369/-0) dist/yaml-cpp/test/gmock-1.7.0/aclocal.m4 (+9799/-0) dist/yaml-cpp/test/gmock-1.7.0/build-aux/config.guess (+1530/-0) dist/yaml-cpp/test/gmock-1.7.0/build-aux/config.h.in (+69/-0) dist/yaml-cpp/test/gmock-1.7.0/build-aux/config.sub (+1773/-0) dist/yaml-cpp/test/gmock-1.7.0/build-aux/depcomp (+688/-0) dist/yaml-cpp/test/gmock-1.7.0/build-aux/install-sh (+527/-0) dist/yaml-cpp/test/gmock-1.7.0/build-aux/ltmain.sh (+9661/-0) dist/yaml-cpp/test/gmock-1.7.0/build-aux/missing (+331/-0) dist/yaml-cpp/test/gmock-1.7.0/configure (+18535/-0) dist/yaml-cpp/test/gmock-1.7.0/configure.ac (+146/-0) dist/yaml-cpp/test/gmock-1.7.0/fused-src/gmock-gtest-all.cc (+11443/-0) dist/yaml-cpp/test/gmock-1.7.0/fused-src/gmock/gmock.h (+14198/-0) dist/yaml-cpp/test/gmock-1.7.0/fused-src/gmock_main.cc (+54/-0) dist/yaml-cpp/test/gmock-1.7.0/fused-src/gtest/gtest.h (+20061/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/CHANGES (+157/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/CMakeLists.txt (+252/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/CONTRIBUTORS (+37/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/LICENSE (+28/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/Makefile.am (+306/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/Makefile.in (+1360/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/README (+435/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/aclocal.m4 (+1198/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/build-aux/config.guess (+1530/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/build-aux/config.h.in (+69/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/build-aux/config.sub (+1773/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/build-aux/depcomp (+688/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/build-aux/install-sh (+527/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/build-aux/ltmain.sh (+9661/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/build-aux/missing (+331/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/cmake/internal_utils.cmake (+227/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/codegear/gtest.cbproj (+138/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/codegear/gtest.groupproj (+54/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/codegear/gtest_all.cc (+38/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/codegear/gtest_link.cc (+40/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/codegear/gtest_main.cbproj (+82/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/codegear/gtest_unittest.cbproj (+88/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/configure (+18222/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/configure.ac (+68/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/fused-src/gtest/gtest-all.cc (+9592/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/fused-src/gtest/gtest.h (+20061/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/fused-src/gtest/gtest_main.cc (+38/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest-death-test.h (+294/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest-message.h (+250/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h (+1421/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h.pump (+487/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest-printers.h (+855/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest-spi.h (+232/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest-test-part.h (+179/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest-typed-test.h (+259/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest.h (+2291/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest_pred_impl.h (+358/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/gtest_prod.h (+58/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-death-test-internal.h (+319/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-filepath.h (+206/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-internal.h (+1158/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-linked_ptr.h (+233/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util-generated.h (+5143/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util-generated.h.pump (+301/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util.h (+619/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-port.h (+1947/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-string.h (+167/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-tuple.h (+1012/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-tuple.h.pump (+339/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-type-util.h (+3331/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/include/gtest/internal/gtest-type-util.h.pump (+297/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/m4/acx_pthread.m4 (+363/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/m4/gtest.m4 (+74/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/m4/libtool.m4 (+8001/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/m4/ltoptions.m4 (+384/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/m4/ltsugar.m4 (+123/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/m4/ltversion.m4 (+23/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/m4/lt~obsolete.m4 (+98/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/make/Makefile (+82/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest-md.sln (+45/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest-md.vcproj (+126/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest.sln (+45/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest.vcproj (+126/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest_main-md.vcproj (+129/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest_main.vcproj (+129/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest_prod_test-md.vcproj (+164/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest_prod_test.vcproj (+164/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest_unittest-md.vcproj (+147/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/msvc/gtest_unittest.vcproj (+147/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/prime_tables.h (+123/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample1.cc (+68/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample1.h (+43/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample10_unittest.cc (+144/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample1_unittest.cc (+153/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample2.cc (+56/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample2.h (+85/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample2_unittest.cc (+109/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample3-inl.h (+172/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample3_unittest.cc (+151/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample4.cc (+46/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample4.h (+53/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample4_unittest.cc (+45/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample5_unittest.cc (+199/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample6_unittest.cc (+224/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample7_unittest.cc (+130/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample8_unittest.cc (+173/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/samples/sample9_unittest.cc (+160/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/scripts/fuse_gtest_files.py (+250/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/scripts/gen_gtest_pred_impl.py (+730/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/scripts/gtest-config.in (+274/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/scripts/pump.py (+855/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/scripts/test/Makefile (+59/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest-all.cc (+48/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest-death-test.cc (+1344/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest-filepath.cc (+382/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest-internal-inl.h (+1218/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest-port.cc (+805/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest-printers.cc (+363/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest-test-part.cc (+110/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest-typed-test.cc (+110/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest.cc (+5015/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/src/gtest_main.cc (+38/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-death-test_ex_test.cc (+93/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-death-test_test.cc (+1367/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-filepath_test.cc (+680/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-linked_ptr_test.cc (+154/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-listener_test.cc (+310/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-message_test.cc (+159/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-options_test.cc (+215/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-param-test2_test.cc (+65/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-param-test_test.cc (+904/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-param-test_test.h (+57/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-port_test.cc (+1253/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-printers_test.cc (+1566/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-test-part_test.cc (+208/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-tuple_test.cc (+320/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-typed-test2_test.cc (+45/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-typed-test_test.cc (+360/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-typed-test_test.h (+66/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest-unittest-api_test.cc (+341/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_all_test.cc (+47/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_break_on_failure_unittest.py (+212/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_break_on_failure_unittest_.cc (+88/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_catch_exceptions_test.py (+237/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_catch_exceptions_test_.cc (+311/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_color_test.py (+130/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_color_test_.cc (+71/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_env_var_test.py (+103/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_env_var_test_.cc (+126/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_environment_test.cc (+192/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_filter_unittest.py (+633/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_filter_unittest_.cc (+140/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_help_test.py (+172/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_help_test_.cc (+46/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_list_tests_unittest.py (+207/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_list_tests_unittest_.cc (+157/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_main_unittest.cc (+45/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_no_test_unittest.cc (+56/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_output_test.py (+335/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_output_test_.cc (+1034/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_output_test_golden_lin.txt (+720/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_pred_impl_unittest.cc (+2427/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_premature_exit_test.cc (+141/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_prod_test.cc (+57/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_repeat_test.cc (+253/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_shuffle_test.py (+325/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_shuffle_test_.cc (+103/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_sole_header_test.cc (+57/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_stress_test.cc (+256/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_test_utils.py (+320/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_throw_on_failure_ex_test.cc (+92/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_throw_on_failure_test.py (+171/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_throw_on_failure_test_.cc (+72/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_uninitialized_test.py (+70/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_uninitialized_test_.cc (+43/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_unittest.cc (+7415/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_xml_outfile1_test_.cc (+49/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_xml_outfile2_test_.cc (+49/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_xml_outfiles_test.py (+132/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_xml_output_unittest.py (+307/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_xml_output_unittest_.cc (+181/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_xml_test_utils.py (+194/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/production.cc (+36/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/test/production.h (+55/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Config/DebugProject.xcconfig (+30/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Config/FrameworkTarget.xcconfig (+17/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Config/General.xcconfig (+41/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Config/ReleaseProject.xcconfig (+32/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Config/StaticLibraryTarget.xcconfig (+18/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Config/TestTarget.xcconfig (+8/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Resources/Info.plist (+30/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Samples/FrameworkSample/Info.plist (+28/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj (+457/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Samples/FrameworkSample/runtests.sh (+62/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Samples/FrameworkSample/widget.cc (+63/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Samples/FrameworkSample/widget.h (+59/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Samples/FrameworkSample/widget_test.cc (+68/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Scripts/runtests.sh (+65/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/Scripts/versiongenerate.py (+100/-0) dist/yaml-cpp/test/gmock-1.7.0/gtest/xcode/gtest.xcodeproj/project.pbxproj (+1135/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-actions.h (+1078/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-cardinalities.h (+147/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-generated-actions.h (+2415/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-generated-actions.h.pump (+821/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-generated-function-mockers.h (+991/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-generated-function-mockers.h.pump (+265/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-generated-matchers.h (+2190/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-generated-matchers.h.pump (+674/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-generated-nice-strict.h (+397/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-generated-nice-strict.h.pump (+161/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-matchers.h (+3986/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-more-actions.h (+233/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-more-matchers.h (+58/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock-spec-builders.h (+1791/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/gmock.h (+94/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/internal/gmock-generated-internal-utils.h (+279/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/internal/gmock-generated-internal-utils.h.pump (+136/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/internal/gmock-internal-utils.h (+498/-0) dist/yaml-cpp/test/gmock-1.7.0/include/gmock/internal/gmock-port.h (+78/-0) dist/yaml-cpp/test/gmock-1.7.0/make/Makefile (+101/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2005/gmock.sln (+32/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2005/gmock.vcproj (+191/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2005/gmock_config.vsprops (+15/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2005/gmock_main.vcproj (+187/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2005/gmock_test.vcproj (+201/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2010/gmock.sln (+32/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2010/gmock.vcxproj (+82/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2010/gmock_config.props (+19/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2010/gmock_main.vcxproj (+88/-0) dist/yaml-cpp/test/gmock-1.7.0/msvc/2010/gmock_test.vcxproj (+101/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/fuse_gmock_files.py (+240/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/LICENSE (+203/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/README (+35/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/README.cppclean (+115/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/cpp/ast.py (+1723/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/cpp/gmock_class.py (+226/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/cpp/keywords.py (+59/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/cpp/tokenize.py (+287/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/cpp/utils.py (+41/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/generator/gmock_gen.py (+31/-0) dist/yaml-cpp/test/gmock-1.7.0/scripts/gmock-config.in (+303/-0) dist/yaml-cpp/test/gmock-1.7.0/src/gmock-all.cc (+47/-0) dist/yaml-cpp/test/gmock-1.7.0/src/gmock-cardinalities.cc (+156/-0) dist/yaml-cpp/test/gmock-1.7.0/src/gmock-internal-utils.cc (+174/-0) dist/yaml-cpp/test/gmock-1.7.0/src/gmock-matchers.cc (+498/-0) dist/yaml-cpp/test/gmock-1.7.0/src/gmock-spec-builders.cc (+813/-0) dist/yaml-cpp/test/gmock-1.7.0/src/gmock.cc (+182/-0) dist/yaml-cpp/test/gmock-1.7.0/src/gmock_main.cc (+54/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-actions_test.cc (+1256/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-cardinalities_test.cc (+428/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-generated-actions_test.cc (+1225/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-generated-function-mockers_test.cc (+588/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-generated-internal-utils_test.cc (+127/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-generated-matchers_test.cc (+1289/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-internal-utils_test.cc (+649/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-matchers_test.cc (+5247/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-more-actions_test.cc (+705/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-nice-strict_test.cc (+424/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-port_test.cc (+43/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock-spec-builders_test.cc (+2613/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_all_test.cc (+48/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_ex_test.cc (+78/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_leak_test.py (+108/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_leak_test_.cc (+100/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_link2_test.cc (+40/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_link_test.cc (+40/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_link_test.h (+669/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_output_test.py (+180/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_output_test_.cc (+291/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_output_test_golden.txt (+310/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_stress_test.cc (+322/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_test.cc (+255/-0) dist/yaml-cpp/test/gmock-1.7.0/test/gmock_test_utils.py (+112/-0) dist/yaml-cpp/test/handler_test.h (+32/-0) dist/yaml-cpp/test/integration/emitter_test.cpp (+1016/-0) dist/yaml-cpp/test/integration/encoding_test.cpp (+182/-0) dist/yaml-cpp/test/integration/gen_emitter_test.cpp (+9759/-0) dist/yaml-cpp/test/integration/handler_spec_test.cpp (+1611/-0) dist/yaml-cpp/test/integration/handler_test.cpp (+46/-0) dist/yaml-cpp/test/integration/load_node_test.cpp (+202/-0) dist/yaml-cpp/test/integration/node_spec_test.cpp (+1131/-0) dist/yaml-cpp/test/main.cpp (+6/-0) dist/yaml-cpp/test/mock_event_handler.h (+26/-0) dist/yaml-cpp/test/node/node_test.cpp (+416/-0) dist/yaml-cpp/test/ostream_wrapper_test.cpp (+66/-0) dist/yaml-cpp/test/specexamples.h (+846/-0) dist/yaml-cpp/util/CMakeLists.txt (+11/-0) dist/yaml-cpp/util/api.cpp (+137/-0) dist/yaml-cpp/util/parse.cpp (+61/-0) dist/yaml-cpp/util/read.cpp (+33/-0) dist/yaml-cpp/util/sandbox.cpp (+36/-0) dist/yaml-cpp/yaml-cpp-config-version.cmake.in (+11/-0) dist/yaml-cpp/yaml-cpp-config.cmake.in (+14/-0) dist/yaml-cpp/yaml-cpp.pc.cmake (+10/-0) |
To merge this branch: | bzr merge lp:~zeller-benjamin/ubuntu-sdk-ide/snapcraft-step2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Zoltan Balogh | Approve | ||
Review via email: mp+308693@code.launchpad.net |
Commit message
Snapcraft support plan step 2
-> support snapcraft.yaml as project format
-> build snap files directly from the IDE
-> basic template
-> support building in containers
Description of the change
Snapcraft support plan step 2
-> support snapcraft.yaml as project format
-> build snap files directly from the IDE
-> basic template
-> support building in containers
To post a comment you must log in.
- 165. By Benjamin Zeller
-
Add missing yaml library
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
review:
Approve
(continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:165
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-09-22 16:11:03 +0000 | |||
3 | +++ CMakeLists.txt 2016-10-18 07:57:32 +0000 | |||
4 | @@ -64,7 +64,11 @@ | |||
5 | 64 | COMMAND ${CMAKE_SOURCE_DIR}/get_bzr_source.py -d "${EXT_SOURCE_DIR}/qtcreator/src/plugins/ubuntu" lp:qtcreator-plugin-ubuntu | 64 | COMMAND ${CMAKE_SOURCE_DIR}/get_bzr_source.py -d "${EXT_SOURCE_DIR}/qtcreator/src/plugins/ubuntu" lp:qtcreator-plugin-ubuntu |
6 | 65 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | 65 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
7 | 66 | 66 | ||
9 | 67 | add_custom_target(sources DEPENDS QtSource LibDusSource MaliitSource fcitx-qtSource AppmenuSource QtCreatorSource) | 67 | add_custom_target(YamlCppSource |
10 | 68 | ${CMAKE_SOURCE_DIR}/get_package_source.py yaml-cpp | ||
11 | 69 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
12 | 70 | |||
13 | 71 | add_custom_target(sources DEPENDS QtSource LibDusSource MaliitSource fcitx-qtSource AppmenuSource QtCreatorSource YamlCppSource) | ||
14 | 68 | 72 | ||
15 | 69 | add_custom_command(TARGET sources | 73 | add_custom_command(TARGET sources |
16 | 70 | PRE_BUILD | 74 | PRE_BUILD |
17 | @@ -123,6 +127,29 @@ | |||
18 | 123 | INSTALL_COMMAND sh -c "LD_LIBRARY_PATH=${QT_INSTALL_DIR}/lib make install" | 127 | INSTALL_COMMAND sh -c "LD_LIBRARY_PATH=${QT_INSTALL_DIR}/lib make install" |
19 | 124 | ) | 128 | ) |
20 | 125 | 129 | ||
21 | 130 | ConcatStrings (LIBYAML_BUILD_SCRIPT | ||
22 | 131 | "${CMAKE_COMMAND} " | ||
23 | 132 | "-DCMAKE_INSTALL_PREFIX=${QT_INSTALL_DIR} " | ||
24 | 133 | "-DCMAKE_PREFIX_PATH=${QT_INSTALL_DIR} " | ||
25 | 134 | "-DCMAKE_BUILD_TYPE=DEBUG" #${CMAKE_BUILD_TYPE_STRING} " | ||
26 | 135 | "-DCMAKE_INSTALL_LIBDIR=lib ${EXT_SOURCE_DIR}/yaml-cpp " | ||
27 | 136 | "-DCMAKE_C_FLAGS=-fPIC " | ||
28 | 137 | "-DCMAKE_CXX_FLAGS=-fPIC " | ||
29 | 138 | ) | ||
30 | 139 | |||
31 | 140 | SET (LIBYAML_PREFIX "${CMAKE_BINARY_DIR}/yaml-cpp") | ||
32 | 141 | ExternalProject_Add(libyaml-cpp | ||
33 | 142 | DEPENDS ${QT_VERSION} | ||
34 | 143 | PREFIX "${LIBYAML_PREFIX}" | ||
35 | 144 | SOURCE_DIR "${EXT_SOURCE_DIR}/yaml-cpp" | ||
36 | 145 | BINARY_DIR "${LIBYAML_PREFIX}/build" | ||
37 | 146 | INSTALL_DIR "${QT_INSTALL_DIR}" | ||
38 | 147 | DOWNLOAD_COMMAND sh -c "exit 0" | ||
39 | 148 | CONFIGURE_COMMAND sh -c "${LIBYAML_BUILD_SCRIPT}" | ||
40 | 149 | BUILD_COMMAND sh -c "LD_LIBRARY_PATH=${QT_INSTALL_DIR}/lib make ${GENERATED_MAKE_FLAGS}" | ||
41 | 150 | INSTALL_COMMAND sh -c "LD_LIBRARY_PATH=${QT_INSTALL_DIR}/lib make install" | ||
42 | 151 | ) | ||
43 | 152 | |||
44 | 126 | SET (MALIITPLUGIN_PREFIX "${CMAKE_BINARY_DIR}/maliit-plugin-qt-build") | 153 | SET (MALIITPLUGIN_PREFIX "${CMAKE_BINARY_DIR}/maliit-plugin-qt-build") |
45 | 127 | ExternalProject_Add(maliit-plugin | 154 | ExternalProject_Add(maliit-plugin |
46 | 128 | DEPENDS ${QT_VERSION} | 155 | DEPENDS ${QT_VERSION} |
47 | @@ -172,7 +199,7 @@ | |||
48 | 172 | 199 | ||
49 | 173 | SET (QTCREATOR_PREFIX "${CMAKE_BINARY_DIR}/qtcreator-build") | 200 | SET (QTCREATOR_PREFIX "${CMAKE_BINARY_DIR}/qtcreator-build") |
50 | 174 | ExternalProject_Add(qtcreator_3.5.0 | 201 | ExternalProject_Add(qtcreator_3.5.0 |
52 | 175 | DEPENDS appmenu-qt5 fcitx-qt5 maliit-plugin | 202 | DEPENDS appmenu-qt5 fcitx-qt5 maliit-plugin libyaml-cpp |
53 | 176 | PREFIX "${QTCREATOR_PREFIX}" | 203 | PREFIX "${QTCREATOR_PREFIX}" |
54 | 177 | SOURCE_DIR "${EXT_SOURCE_DIR}/qtcreator" | 204 | SOURCE_DIR "${EXT_SOURCE_DIR}/qtcreator" |
55 | 178 | BINARY_DIR "${QTCREATOR_PREFIX}/build" | 205 | BINARY_DIR "${QTCREATOR_PREFIX}/build" |
56 | 179 | 206 | ||
57 | === modified file 'dist/qtcreator/src/plugins/ubuntu/UbuntuPlugin.pro' | |||
58 | --- dist/qtcreator/src/plugins/ubuntu/UbuntuPlugin.pro 2016-09-22 16:11:03 +0000 | |||
59 | +++ dist/qtcreator/src/plugins/ubuntu/UbuntuPlugin.pro 2016-10-18 07:57:32 +0000 | |||
60 | @@ -220,6 +220,8 @@ | |||
61 | 220 | src/ubuntu/device/remote/ubuntudirectuploadstep.h \ | 220 | src/ubuntu/device/remote/ubuntudirectuploadstep.h \ |
62 | 221 | src/ubuntu/device/remote/ubuntudeploystepfactory.h | 221 | src/ubuntu/device/remote/ubuntudeploystepfactory.h |
63 | 222 | 222 | ||
64 | 223 | include(src/ubuntu/snap/snap.pri) | ||
65 | 224 | |||
66 | 223 | 225 | ||
67 | 224 | FORMS += \ | 226 | FORMS += \ |
68 | 225 | src/ubuntu/device/remote/ubunturemoterunconfigurationwidget.ui \ | 227 | src/ubuntu/device/remote/ubunturemoterunconfigurationwidget.ui \ |
69 | 226 | 228 | ||
70 | === removed file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName.pro' | |||
71 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName.pro 2016-09-22 16:11:03 +0000 | |||
72 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName.pro 1970-01-01 00:00:00 +0000 | |||
73 | @@ -1,32 +0,0 @@ | |||
74 | 1 | # This is the basic qmake template for the Ubuntu-SDK | ||
75 | 2 | # it handles creation and installation of the manifest | ||
76 | 3 | # file and takes care of subprojects | ||
77 | 4 | TEMPLATE = subdirs | ||
78 | 5 | |||
79 | 6 | SUBDIRS += %{ProjectNameL} | ||
80 | 7 | |||
81 | 8 | # enables/disabled the extra targets to build a snapcraft package | ||
82 | 9 | # also tells the IDE this is a snapcraft project | ||
83 | 10 | CONFIG += snapcraft | ||
84 | 11 | |||
85 | 12 | snapcraft { | ||
86 | 13 | |||
87 | 14 | SNAPCRAFT_FILE=snapcraft.yaml | ||
88 | 15 | |||
89 | 16 | #the Ubuntu SDK IDE uses the snap target to create the package | ||
90 | 17 | snappy.target = snap | ||
91 | 18 | snappy.commands = cd $$OUT_PWD | ||
92 | 19 | snappy.commands += && rm -rf \'$$OUT_PWD/snap-deploy\' | ||
93 | 20 | snappy.commands += && make INSTALL_ROOT=$$OUT_PWD/snap-deploy install | ||
94 | 21 | snappy.commands += && cd $$OUT_PWD/snap-deploy | ||
95 | 22 | snappy.commands += && snapcraft | ||
96 | 23 | |||
97 | 24 | OTHER_FILES+=$$SNAPCRAFT_FILE | ||
98 | 25 | QMAKE_EXTRA_TARGETS += snappy | ||
99 | 26 | |||
100 | 27 | packaging.files = $$SNAPCRAFT_FILE | ||
101 | 28 | packaging.path = / | ||
102 | 29 | |||
103 | 30 | INSTALLS+=packaging | ||
104 | 31 | } | ||
105 | 32 | |||
106 | 33 | 0 | ||
107 | === removed file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.desktop' | |||
108 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.desktop 2016-09-22 16:11:03 +0000 | |||
109 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.desktop 1970-01-01 00:00:00 +0000 | |||
110 | @@ -1,9 +0,0 @@ | |||
111 | 1 | [Desktop Entry] | ||
112 | 2 | Version=1.0 | ||
113 | 3 | Name=%{ProjectNameL} | ||
114 | 4 | Exec=%{ProjectNameL} | ||
115 | 5 | TryExec=%{ProjectNameL} | ||
116 | 6 | Icon=${SNAP}/meta/gui/%{ProjectNameL}.png | ||
117 | 7 | Terminal=false | ||
118 | 8 | Type=Application | ||
119 | 9 | X-Ubuntu-Touch=true | ||
120 | 10 | 0 | ||
121 | === removed file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png' | |||
122 | 11 | Binary files dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png 2016-09-22 16:11:03 +0000 and dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png 1970-01-01 00:00:00 +0000 differ | 1 | Binary files dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png 2016-09-22 16:11:03 +0000 and dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.png 1970-01-01 00:00:00 +0000 differ |
123 | === modified file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.pro' | |||
124 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.pro 2016-09-22 16:11:03 +0000 | |||
125 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/appName/appName.pro 2016-10-18 07:57:32 +0000 | |||
126 | @@ -16,33 +16,16 @@ | |||
127 | 16 | 16 | ||
128 | 17 | CONF_FILES += %{ProjectNameL}.png | 17 | CONF_FILES += %{ProjectNameL}.png |
129 | 18 | 18 | ||
130 | 19 | AP_TEST_FILES += tests/autopilot/run \ | ||
131 | 20 | $$files(tests/*.py,true) | ||
132 | 21 | |||
133 | 22 | #show all the files in QtCreator | 19 | #show all the files in QtCreator |
134 | 23 | OTHER_FILES += $${CONF_FILES} \ | 20 | OTHER_FILES += $${CONF_FILES} \ |
135 | 24 | $${QML_FILES} \ | 21 | $${QML_FILES} \ |
136 | 25 | $${AP_TEST_FILES} \ | ||
137 | 26 | %{ProjectNameL}.desktop \ | 22 | %{ProjectNameL}.desktop \ |
138 | 27 | %{ProjectNameL}.wrapper | 23 | %{ProjectNameL}.wrapper |
139 | 28 | 24 | ||
140 | 29 | snapcraft { | 25 | snapcraft { |
141 | 30 | #specify where the config files are installed to | ||
142 | 31 | config_files.path = /setup/gui | ||
143 | 32 | config_files.files += $${CONF_FILES} | ||
144 | 33 | INSTALLS+=config_files | ||
145 | 34 | |||
146 | 35 | #install the desktop file | ||
147 | 36 | desktop_file.path = /setup/gui | ||
148 | 37 | desktop_file.files = $$PWD/%{ProjectNameL}.desktop | ||
149 | 38 | desktop_file.CONFIG += no_check_exist | ||
150 | 39 | INSTALLS+=desktop_file | ||
151 | 40 | |||
152 | 41 | # Default rules for deployment. | ||
153 | 42 | |||
154 | 43 | wrapper.files = %{ProjectNameL}.wrapper | 26 | wrapper.files = %{ProjectNameL}.wrapper |
156 | 44 | wrapper.path = /deploy/bin | 27 | wrapper.path = /bin |
157 | 45 | 28 | ||
159 | 46 | target.path = /deploy/bin | 29 | target.path = /bin |
160 | 47 | INSTALLS+=target wrapper | 30 | INSTALLS+=target wrapper |
161 | 48 | } | 31 | } |
162 | 49 | 32 | ||
163 | === added directory 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup' | |||
164 | === added directory 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui' | |||
165 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.desktop' | |||
166 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.desktop 1970-01-01 00:00:00 +0000 | |||
167 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.desktop 2016-10-18 07:57:32 +0000 | |||
168 | @@ -0,0 +1,9 @@ | |||
169 | 1 | [Desktop Entry] | ||
170 | 2 | Version=1.0 | ||
171 | 3 | Name=%{ProjectNameL} | ||
172 | 4 | Exec=%{ProjectNameL} | ||
173 | 5 | TryExec=%{ProjectNameL} | ||
174 | 6 | Icon=${SNAP}/meta/gui/%{ProjectNameL}.png | ||
175 | 7 | Terminal=false | ||
176 | 8 | Type=Application | ||
177 | 9 | X-Ubuntu-Touch=true | ||
178 | 0 | 10 | ||
179 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.png' | |||
180 | 1 | Binary files dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.png 1970-01-01 00:00:00 +0000 and dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.png 2016-10-18 07:57:32 +0000 differ | 11 | Binary files dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.png 1970-01-01 00:00:00 +0000 and dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/setup/gui/appName.png 2016-10-18 07:57:32 +0000 differ |
181 | === modified file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/snapcraft.yaml' | |||
182 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/snapcraft.yaml 2016-09-22 16:11:03 +0000 | |||
183 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/snapcraft.yaml 2016-10-18 07:57:32 +0000 | |||
184 | @@ -11,13 +11,19 @@ | |||
185 | 11 | 11 | ||
186 | 12 | parts: | 12 | parts: |
187 | 13 | %{ProjectNameL}: | 13 | %{ProjectNameL}: |
190 | 14 | plugin: dump | 14 | plugin: qmake |
191 | 15 | source: deploy/ | 15 | source: %{ProjectNameL}/ |
192 | 16 | qt-version: qt5 | ||
193 | 17 | options: ["CONFIG+=snapcraft"] | ||
194 | 18 | project-files: [%{ProjectNameL}] | ||
195 | 19 | build-packages: | ||
196 | 20 | - build-essential | ||
197 | 21 | - qtbase5-dev | ||
198 | 22 | - qt5-qmake | ||
199 | 16 | stage-packages: | 23 | stage-packages: |
200 | 17 | - ubuntu-sdk-libs | 24 | - ubuntu-sdk-libs |
201 | 18 | - qtubuntu-desktop | 25 | - qtubuntu-desktop |
202 | 19 | - qtmir-desktop | 26 | - qtmir-desktop |
203 | 20 | - mir-graphics-drivers-desktop | 27 | - mir-graphics-drivers-desktop |
206 | 21 | 28 | after: [qt5conf] | |
205 | 22 | |||
207 | 23 | 29 | ||
208 | 24 | 30 | ||
209 | === modified file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/wizard.json' | |||
210 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/wizard.json 2016-09-22 16:11:03 +0000 | |||
211 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/templates/wizards/ubuntu/snap-qtquick-app-qmake/wizard.json 2016-10-18 07:57:32 +0000 | |||
212 | @@ -1,13 +1,13 @@ | |||
213 | 1 | { | 1 | { |
214 | 2 | "version": 1, | 2 | "version": 1, |
216 | 3 | "supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ], | 3 | "supportedProjectTypes": [ "SnapcraftProjectManager.SnapcraftProject" ], |
217 | 4 | "id": "A.QtQuick Snappy Application", | 4 | "id": "A.QtQuick Snappy Application", |
218 | 5 | "category": "B.Snapcraft", | 5 | "category": "B.Snapcraft", |
219 | 6 | "trDescription": "Creates a experimental C++ Ubuntu snappy application project with a sample UI containing a Label and a Button.", | 6 | "trDescription": "Creates a experimental C++ Ubuntu snappy application project with a sample UI containing a Label and a Button.", |
220 | 7 | "trDisplayName": "QtQuick App with QML Ubuntu UI", | 7 | "trDisplayName": "QtQuick App with QML Ubuntu UI", |
221 | 8 | "trDisplayCategory": "Snapcraft", | 8 | "trDisplayCategory": "Snapcraft", |
222 | 9 | "icon": "../share/ubuntu.png", | 9 | "icon": "../share/ubuntu.png", |
224 | 10 | "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}", | 10 | "enabled": "%{JS: [ %{Plugins} ].indexOf('Ubuntu') >= 0}", |
225 | 11 | 11 | ||
226 | 12 | "options": | 12 | "options": |
227 | 13 | [ | 13 | [ |
228 | @@ -62,15 +62,10 @@ | |||
229 | 62 | "data": | 62 | "data": |
230 | 63 | [ | 63 | [ |
231 | 64 | { | 64 | { |
234 | 65 | "source": "appName.pro", | 65 | "source": "snapcraft.yaml", |
233 | 66 | "target": "%{ProjectFile}", | ||
235 | 67 | "openAsProject": true | 66 | "openAsProject": true |
236 | 68 | }, | 67 | }, |
237 | 69 | { | 68 | { |
238 | 70 | "source": "snapcraft.yaml", | ||
239 | 71 | "openInEditor": true | ||
240 | 72 | }, | ||
241 | 73 | { | ||
242 | 74 | "source": "appName/main.cpp", | 69 | "source": "appName/main.cpp", |
243 | 75 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{CppFileName}", | 70 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{CppFileName}", |
244 | 76 | "openInEditor": true | 71 | "openInEditor": true |
245 | @@ -81,12 +76,12 @@ | |||
246 | 81 | "openInEditor": true | 76 | "openInEditor": true |
247 | 82 | }, | 77 | }, |
248 | 83 | { | 78 | { |
251 | 84 | "source": "appName/appName.desktop", | 79 | "source": "setup/gui/appName.desktop", |
252 | 85 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{ProjectNameL}.desktop" | 80 | "target": "%{ProjectDirectory}/setup/gui/%{ProjectNameL}.desktop" |
253 | 86 | }, | 81 | }, |
254 | 87 | { | 82 | { |
257 | 88 | "source": "appName/appName.png", | 83 | "source": "setup/gui/appName.png", |
258 | 89 | "target": "%{ProjectDirectory}/%{ProjectNameL}/%{ProjectNameL}.png" | 84 | "target": "%{ProjectDirectory}/setup/gui/%{ProjectNameL}.png" |
259 | 90 | }, | 85 | }, |
260 | 91 | { | 86 | { |
261 | 92 | "source": "appName/appName.pro", | 87 | "source": "appName/appName.pro", |
262 | 93 | 88 | ||
263 | === added file 'dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/scripts/run_snapcraft.py' | |||
264 | --- dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/scripts/run_snapcraft.py 1970-01-01 00:00:00 +0000 | |||
265 | +++ dist/qtcreator/src/plugins/ubuntu/share/qtcreator/ubuntu/scripts/run_snapcraft.py 2016-10-18 07:57:32 +0000 | |||
266 | @@ -0,0 +1,29 @@ | |||
267 | 1 | #!/usr/bin/python3 | ||
268 | 2 | |||
269 | 3 | import os | ||
270 | 4 | import sys | ||
271 | 5 | import shutil | ||
272 | 6 | import subprocess | ||
273 | 7 | from optparse import OptionParser | ||
274 | 8 | |||
275 | 9 | parser = OptionParser(usage="usage: %prog [options] lp:branch") | ||
276 | 10 | parser.add_option( | ||
277 | 11 | "-s", "--snapcraft", dest="snapcraft") | ||
278 | 12 | options, args = parser.parse_args() | ||
279 | 13 | |||
280 | 14 | if options.snapcraft is None: | ||
281 | 15 | options.snapcraft = shutil.which("snapcraft") | ||
282 | 16 | |||
283 | 17 | if options.snapcraft is None: | ||
284 | 18 | parser.error("Snapcraft not found.") | ||
285 | 19 | |||
286 | 20 | if not os.path.isfile(options.snapcraft) or not os.access(options.snapcraft, os.X_OK): | ||
287 | 21 | parser.error("-s must specify a executable file.") | ||
288 | 22 | |||
289 | 23 | print("Using snapcraft from :"+options.snapcraft) | ||
290 | 24 | |||
291 | 25 | ret = subprocess.call([options.snapcraft, "clean"]) | ||
292 | 26 | if ret != 0: | ||
293 | 27 | sys.exit(ret) | ||
294 | 28 | |||
295 | 29 | sys.exit(subprocess.call([options.snapcraft]+args)) | ||
296 | 0 | 30 | ||
297 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/UbuntuProject.mimetypes.xml' | |||
298 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/UbuntuProject.mimetypes.xml 2016-06-09 08:47:42 +0000 | |||
299 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/UbuntuProject.mimetypes.xml 2016-10-18 07:57:32 +0000 | |||
300 | @@ -17,4 +17,9 @@ | |||
301 | 17 | <sub-class-of type="application/json"/> | 17 | <sub-class-of type="application/json"/> |
302 | 18 | <glob pattern="manifest.json*"/> | 18 | <glob pattern="manifest.json*"/> |
303 | 19 | </mime-type> | 19 | </mime-type> |
304 | 20 | <mime-type type="application/x-snapcraft"> | ||
305 | 21 | <comment>Snapcraft project file</comment> | ||
306 | 22 | <sub-class-of type="application/x-yaml"/> | ||
307 | 23 | <glob pattern="snapcraft.yaml"/> | ||
308 | 24 | </mime-type> | ||
309 | 20 | </mime-info> | 25 | </mime-info> |
310 | 21 | 26 | ||
311 | === added directory 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project' | |||
312 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfiguration.cpp' | |||
313 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfiguration.cpp 1970-01-01 00:00:00 +0000 | |||
314 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfiguration.cpp 2016-10-18 07:57:32 +0000 | |||
315 | @@ -0,0 +1,41 @@ | |||
316 | 1 | #include "snapcraftbuildconfiguration.h" | ||
317 | 2 | |||
318 | 3 | #include <ubuntu/ubuntuconstants.h> | ||
319 | 4 | |||
320 | 5 | namespace Ubuntu { | ||
321 | 6 | namespace Internal { | ||
322 | 7 | |||
323 | 8 | SnapcraftBuildConfiguration::SnapcraftBuildConfiguration(ProjectExplorer::Target *target) | ||
324 | 9 | : ProjectExplorer::BuildConfiguration(target, Constants::SNAPCRAFT_BUILDCONFIGURATION_ID) | ||
325 | 10 | { | ||
326 | 11 | |||
327 | 12 | } | ||
328 | 13 | |||
329 | 14 | SnapcraftBuildConfiguration::SnapcraftBuildConfiguration(ProjectExplorer::Target *target, ProjectExplorer::BuildConfiguration *source) | ||
330 | 15 | : ProjectExplorer::BuildConfiguration(target, source) | ||
331 | 16 | { | ||
332 | 17 | |||
333 | 18 | } | ||
334 | 19 | |||
335 | 20 | bool SnapcraftBuildConfiguration::fromMap(const QVariantMap &map) | ||
336 | 21 | { | ||
337 | 22 | return ProjectExplorer::BuildConfiguration::fromMap(map); | ||
338 | 23 | } | ||
339 | 24 | |||
340 | 25 | QVariantMap SnapcraftBuildConfiguration::toMap() const | ||
341 | 26 | { | ||
342 | 27 | return ProjectExplorer::BuildConfiguration::toMap(); | ||
343 | 28 | } | ||
344 | 29 | |||
345 | 30 | ProjectExplorer::NamedWidget *SnapcraftBuildConfiguration::createConfigWidget() | ||
346 | 31 | { | ||
347 | 32 | return nullptr; | ||
348 | 33 | } | ||
349 | 34 | |||
350 | 35 | ProjectExplorer::BuildConfiguration::BuildType SnapcraftBuildConfiguration::buildType() const | ||
351 | 36 | { | ||
352 | 37 | return ProjectExplorer::BuildConfiguration::Unknown; | ||
353 | 38 | } | ||
354 | 39 | |||
355 | 40 | } // namespace Internal | ||
356 | 41 | } // namespace Ubuntu | ||
357 | 0 | 42 | ||
358 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfiguration.h' | |||
359 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfiguration.h 1970-01-01 00:00:00 +0000 | |||
360 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfiguration.h 2016-10-18 07:57:32 +0000 | |||
361 | @@ -0,0 +1,33 @@ | |||
362 | 1 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTBUILDCONFIGURATION_H | ||
363 | 2 | #define UBUNTU_INTERNAL_SNAPCRAFTBUILDCONFIGURATION_H | ||
364 | 3 | |||
365 | 4 | #include <projectexplorer/buildconfiguration.h> | ||
366 | 5 | |||
367 | 6 | namespace Ubuntu { | ||
368 | 7 | namespace Internal { | ||
369 | 8 | |||
370 | 9 | class SnapcraftBuildConfigurationFactory; | ||
371 | 10 | |||
372 | 11 | class SnapcraftBuildConfiguration : public ProjectExplorer::BuildConfiguration | ||
373 | 12 | { | ||
374 | 13 | Q_OBJECT | ||
375 | 14 | |||
376 | 15 | public: | ||
377 | 16 | friend class SnapcraftBuildConfigurationFactory; | ||
378 | 17 | // ProjectConfiguration interface | ||
379 | 18 | virtual bool fromMap(const QVariantMap &map) override; | ||
380 | 19 | virtual QVariantMap toMap() const override; | ||
381 | 20 | |||
382 | 21 | // BuildConfiguration interface | ||
383 | 22 | virtual ProjectExplorer::NamedWidget *createConfigWidget() override; | ||
384 | 23 | virtual BuildType buildType() const override; | ||
385 | 24 | |||
386 | 25 | protected: | ||
387 | 26 | SnapcraftBuildConfiguration(ProjectExplorer::Target *target); | ||
388 | 27 | SnapcraftBuildConfiguration(ProjectExplorer::Target *target, BuildConfiguration *source); | ||
389 | 28 | }; | ||
390 | 29 | |||
391 | 30 | } // namespace Internal | ||
392 | 31 | } // namespace Ubuntu | ||
393 | 32 | |||
394 | 33 | #endif // UBUNTU_INTERNAL_SNAPCRAFTBUILDCONFIGURATION_H | ||
395 | 0 | 34 | ||
396 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfigurationfactory.cpp' | |||
397 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfigurationfactory.cpp 1970-01-01 00:00:00 +0000 | |||
398 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfigurationfactory.cpp 2016-10-18 07:57:32 +0000 | |||
399 | @@ -0,0 +1,145 @@ | |||
400 | 1 | #include "snapcraftbuildconfigurationfactory.h" | ||
401 | 2 | |||
402 | 3 | #include "snapcraftproject.h" | ||
403 | 4 | #include "snapcraftbuildconfiguration.h" | ||
404 | 5 | #include "snapcraftrsyncstep.h" | ||
405 | 6 | #include "snapcraftstep.h" | ||
406 | 7 | #include <ubuntu/ubuntuconstants.h> | ||
407 | 8 | |||
408 | 9 | #include <projectexplorer/target.h> | ||
409 | 10 | #include <projectexplorer/kit.h> | ||
410 | 11 | #include <projectexplorer/projectmacroexpander.h> | ||
411 | 12 | #include <projectexplorer/projectexplorerconstants.h> | ||
412 | 13 | #include <projectexplorer/buildsteplist.h> | ||
413 | 14 | |||
414 | 15 | #include <coreplugin/documentmanager.h> | ||
415 | 16 | #include <utils/mimetypes/mimedatabase.h> | ||
416 | 17 | #include <utils/qtcassert.h> | ||
417 | 18 | |||
418 | 19 | namespace Ubuntu { | ||
419 | 20 | namespace Internal { | ||
420 | 21 | |||
421 | 22 | SnapcraftBuildInfo::SnapcraftBuildInfo(const SnapcraftBuildConfigurationFactory *factory) | ||
422 | 23 | :ProjectExplorer::BuildInfo(factory) | ||
423 | 24 | { | ||
424 | 25 | |||
425 | 26 | } | ||
426 | 27 | |||
427 | 28 | SnapcraftBuildConfigurationFactory::SnapcraftBuildConfigurationFactory() | ||
428 | 29 | { | ||
429 | 30 | |||
430 | 31 | } | ||
431 | 32 | |||
432 | 33 | QList<ProjectExplorer::BuildInfo *> SnapcraftBuildConfigurationFactory::availableBuilds(const ProjectExplorer::Target *parent) const | ||
433 | 34 | { | ||
434 | 35 | if (qobject_cast<SnapcraftProject *>(parent->project())) | ||
435 | 36 | return {}; | ||
436 | 37 | |||
437 | 38 | QList<ProjectExplorer::BuildInfo *> infoList; | ||
438 | 39 | ProjectExplorer::BuildInfo *info = createBuildInfo(parent->kit(), parent->project()->projectFilePath().toString()); | ||
439 | 40 | if (info) | ||
440 | 41 | infoList << info; | ||
441 | 42 | |||
442 | 43 | return infoList; | ||
443 | 44 | } | ||
444 | 45 | |||
445 | 46 | int SnapcraftBuildConfigurationFactory::priority(const ProjectExplorer::Target *) const | ||
446 | 47 | { | ||
447 | 48 | return 0; | ||
448 | 49 | } | ||
449 | 50 | |||
450 | 51 | int SnapcraftBuildConfigurationFactory::priority(const ProjectExplorer::Kit *, const QString &) const | ||
451 | 52 | { | ||
452 | 53 | return 0; | ||
453 | 54 | } | ||
454 | 55 | |||
455 | 56 | QList<ProjectExplorer::BuildInfo *> SnapcraftBuildConfigurationFactory::availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const | ||
456 | 57 | { | ||
457 | 58 | Utils::MimeDatabase db; | ||
458 | 59 | |||
459 | 60 | auto mimeType = db.mimeTypeForFile(projectPath); | ||
460 | 61 | if (!mimeType.matchesName(Constants::SNAPCRAFT_PROJECT_MIMETYPE)) | ||
461 | 62 | return {}; | ||
462 | 63 | |||
463 | 64 | QList<ProjectExplorer::BuildInfo *> infoList; | ||
464 | 65 | ProjectExplorer::BuildInfo *info = createBuildInfo(k, projectPath); | ||
465 | 66 | if (info) | ||
466 | 67 | infoList << info; | ||
467 | 68 | |||
468 | 69 | return infoList; | ||
469 | 70 | } | ||
470 | 71 | |||
471 | 72 | ProjectExplorer::BuildConfiguration *SnapcraftBuildConfigurationFactory::create(ProjectExplorer::Target *parent, const ProjectExplorer::BuildInfo *info) const | ||
472 | 73 | { | ||
473 | 74 | SnapcraftBuildConfiguration *conf = new SnapcraftBuildConfiguration(parent); | ||
474 | 75 | |||
475 | 76 | conf->setDisplayName(info->displayName); | ||
476 | 77 | conf->setBuildDirectory(info->buildDirectory); | ||
477 | 78 | |||
478 | 79 | ProjectExplorer::BuildStepList *bs = conf->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); | ||
479 | 80 | bs->insertStep(0, new SnapcraftRsyncStep(bs)); | ||
480 | 81 | bs->insertStep(1, new SnapcraftStep(bs)); | ||
481 | 82 | |||
482 | 83 | return conf; | ||
483 | 84 | } | ||
484 | 85 | |||
485 | 86 | bool SnapcraftBuildConfigurationFactory::canRestore(const ProjectExplorer::Target *, const QVariantMap &map) const | ||
486 | 87 | { | ||
487 | 88 | return (ProjectExplorer::idFromMap(map) == Constants::SNAPCRAFT_BUILDCONFIGURATION_ID); | ||
488 | 89 | } | ||
489 | 90 | |||
490 | 91 | ProjectExplorer::BuildConfiguration *SnapcraftBuildConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) | ||
491 | 92 | { | ||
492 | 93 | QTC_ASSERT(parent, return nullptr); | ||
493 | 94 | SnapcraftBuildConfiguration *conf = new SnapcraftBuildConfiguration(parent); | ||
494 | 95 | if (conf->fromMap(map)) | ||
495 | 96 | return conf; | ||
496 | 97 | |||
497 | 98 | delete conf; | ||
498 | 99 | return nullptr; | ||
499 | 100 | } | ||
500 | 101 | |||
501 | 102 | bool SnapcraftBuildConfigurationFactory::canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) const | ||
502 | 103 | { | ||
503 | 104 | QTC_ASSERT(parent, return false); | ||
504 | 105 | QTC_ASSERT(product, return false); | ||
505 | 106 | return (product->id() == Constants::SNAPCRAFT_BUILDCONFIGURATION_ID); | ||
506 | 107 | } | ||
507 | 108 | |||
508 | 109 | ProjectExplorer::BuildConfiguration *SnapcraftBuildConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) | ||
509 | 110 | { | ||
510 | 111 | QTC_ASSERT(parent, return nullptr); | ||
511 | 112 | QTC_ASSERT(product, return nullptr); | ||
512 | 113 | |||
513 | 114 | SnapcraftBuildConfiguration *conf = new SnapcraftBuildConfiguration(parent, product); | ||
514 | 115 | return conf; | ||
515 | 116 | } | ||
516 | 117 | |||
517 | 118 | ProjectExplorer::BuildInfo *SnapcraftBuildConfigurationFactory::createBuildInfo(const ProjectExplorer::Kit *k, const QString &projectPath) const | ||
518 | 119 | { | ||
519 | 120 | SnapcraftBuildInfo *build = new SnapcraftBuildInfo(this); | ||
520 | 121 | build->buildType = ProjectExplorer::BuildConfiguration::Release; | ||
521 | 122 | build->typeName = tr("Build"); | ||
522 | 123 | build->kitId = k->id(); | ||
523 | 124 | build->displayName = ProjectExplorer::BuildConfiguration::buildTypeName(build->buildType); | ||
524 | 125 | build->buildDirectory = shadowBuildDirectory(k, projectPath); | ||
525 | 126 | return {build}; | ||
526 | 127 | } | ||
527 | 128 | |||
528 | 129 | Utils::FileName SnapcraftBuildConfigurationFactory::shadowBuildDirectory(const ProjectExplorer::Kit *k, const QString &projectPath) const | ||
529 | 130 | { | ||
530 | 131 | |||
531 | 132 | Utils::FileName projectDir = ProjectExplorer::Project::projectDirectory(Utils::FileName::fromString(projectPath)); | ||
532 | 133 | const QString projectName = projectDir.fileName(); | ||
533 | 134 | |||
534 | 135 | ProjectExplorer::ProjectMacroExpander expander(projectPath, projectName, | ||
535 | 136 | k, tr("build"), | ||
536 | 137 | ProjectExplorer::BuildConfiguration::Release); | ||
537 | 138 | |||
538 | 139 | QString buildPath = expander.expand(Core::DocumentManager::buildDirectory()); | ||
539 | 140 | return Utils::FileName::fromString(QDir::cleanPath(QDir(projectDir.toString()).absoluteFilePath(buildPath))); | ||
540 | 141 | } | ||
541 | 142 | |||
542 | 143 | |||
543 | 144 | } // namespace Internal | ||
544 | 145 | } // namespace Ubuntu | ||
545 | 0 | 146 | ||
546 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfigurationfactory.h' | |||
547 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfigurationfactory.h 1970-01-01 00:00:00 +0000 | |||
548 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildconfigurationfactory.h 2016-10-18 07:57:32 +0000 | |||
549 | @@ -0,0 +1,44 @@ | |||
550 | 1 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTBUILDCONFIGURATIONFACTORY_H | ||
551 | 2 | #define UBUNTU_INTERNAL_SNAPCRAFTBUILDCONFIGURATIONFACTORY_H | ||
552 | 3 | |||
553 | 4 | #include <projectexplorer/buildconfiguration.h> | ||
554 | 5 | #include <projectexplorer/buildinfo.h> | ||
555 | 6 | |||
556 | 7 | namespace Ubuntu { | ||
557 | 8 | namespace Internal { | ||
558 | 9 | |||
559 | 10 | class SnapcraftBuildConfigurationFactory; | ||
560 | 11 | |||
561 | 12 | class SnapcraftBuildInfo : public ProjectExplorer::BuildInfo | ||
562 | 13 | { | ||
563 | 14 | public: | ||
564 | 15 | SnapcraftBuildInfo(const SnapcraftBuildConfigurationFactory *factory); | ||
565 | 16 | }; | ||
566 | 17 | |||
567 | 18 | class SnapcraftBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory | ||
568 | 19 | { | ||
569 | 20 | public: | ||
570 | 21 | SnapcraftBuildConfigurationFactory(); | ||
571 | 22 | |||
572 | 23 | // IBuildConfigurationFactory interface | ||
573 | 24 | virtual QList<ProjectExplorer::BuildInfo *> availableBuilds(const ProjectExplorer::Target *parent) const override; | ||
574 | 25 | |||
575 | 26 | virtual int priority(const ProjectExplorer::Target *parent) const override; | ||
576 | 27 | virtual int priority(const ProjectExplorer::Kit *k, const QString &projectPath) const override; | ||
577 | 28 | |||
578 | 29 | virtual QList<ProjectExplorer::BuildInfo *> availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const override; | ||
579 | 30 | virtual ProjectExplorer::BuildConfiguration *create(ProjectExplorer::Target *parent, const ProjectExplorer::BuildInfo *info) const override; | ||
580 | 31 | virtual bool canRestore(const ProjectExplorer::Target *parent, const QVariantMap &map) const override; | ||
581 | 32 | virtual ProjectExplorer::BuildConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map) override; | ||
582 | 33 | virtual bool canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) const override; | ||
583 | 34 | virtual ProjectExplorer::BuildConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) override; | ||
584 | 35 | |||
585 | 36 | private: | ||
586 | 37 | ProjectExplorer::BuildInfo *createBuildInfo (const ProjectExplorer::Kit *k, const QString &projectPath) const; | ||
587 | 38 | Utils::FileName shadowBuildDirectory(const ProjectExplorer::Kit *k, const QString &projectPath) const; | ||
588 | 39 | }; | ||
589 | 40 | |||
590 | 41 | } // namespace Internal | ||
591 | 42 | } // namespace Ubuntu | ||
592 | 43 | |||
593 | 44 | #endif // UBUNTU_INTERNAL_SNAPCRAFTBUILDCONFIGURATIONFACTORY_H | ||
594 | 0 | 45 | ||
595 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildstepfactory.cpp' | |||
596 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildstepfactory.cpp 1970-01-01 00:00:00 +0000 | |||
597 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildstepfactory.cpp 2016-10-18 07:57:32 +0000 | |||
598 | @@ -0,0 +1,65 @@ | |||
599 | 1 | #include "snapcraftbuildstepfactory.h" | ||
600 | 2 | #include "snapcraftrsyncstep.h" | ||
601 | 3 | #include "snapcraftstep.h" | ||
602 | 4 | #include "snapcraftproject.h" | ||
603 | 5 | |||
604 | 6 | #include <ubuntu/ubuntuconstants.h> | ||
605 | 7 | |||
606 | 8 | #include <projectexplorer/projectexplorerconstants.h> | ||
607 | 9 | #include <projectexplorer/buildsteplist.h> | ||
608 | 10 | #include <projectexplorer/target.h> | ||
609 | 11 | #include <utils/algorithm.h> | ||
610 | 12 | |||
611 | 13 | namespace Ubuntu { | ||
612 | 14 | namespace Internal { | ||
613 | 15 | |||
614 | 16 | SnapcraftBuildStepFactory::SnapcraftBuildStepFactory(QObject *parent) : ProjectExplorer::IBuildStepFactory (parent) | ||
615 | 17 | { | ||
616 | 18 | |||
617 | 19 | } | ||
618 | 20 | |||
619 | 21 | QList<ProjectExplorer::BuildStepInfo> SnapcraftBuildStepFactory::availableSteps(ProjectExplorer::BuildStepList *parent) const | ||
620 | 22 | { | ||
621 | 23 | if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD) | ||
622 | 24 | return {}; | ||
623 | 25 | |||
624 | 26 | if (!parent->target() || !qobject_cast<SnapcraftProject *>(parent->target()->project())) | ||
625 | 27 | return {}; | ||
626 | 28 | |||
627 | 29 | return { | ||
628 | 30 | ProjectExplorer::BuildStepInfo(Constants::SNAPCRAFT_RSYNCBUILSSTEP_ID, tr("Prepare build")), | ||
629 | 31 | ProjectExplorer::BuildStepInfo(Constants::SNAPCRAFT_BUILDSTEP_ID, tr("Snapcraft")) | ||
630 | 32 | }; | ||
631 | 33 | } | ||
632 | 34 | |||
633 | 35 | ProjectExplorer::BuildStep *SnapcraftBuildStepFactory::create(ProjectExplorer::BuildStepList *parent, Core::Id id) | ||
634 | 36 | { | ||
635 | 37 | if (!Utils::contains(availableSteps(parent), [&id](const ProjectExplorer::BuildStepInfo &step){return id == step.id;})) | ||
636 | 38 | return nullptr; | ||
637 | 39 | |||
638 | 40 | if (id == Constants::SNAPCRAFT_RSYNCBUILSSTEP_ID) { | ||
639 | 41 | return new SnapcraftRsyncStep(parent); | ||
640 | 42 | } else if (id == Constants::SNAPCRAFT_BUILDSTEP_ID) { | ||
641 | 43 | return new SnapcraftStep(parent); | ||
642 | 44 | } | ||
643 | 45 | |||
644 | 46 | return nullptr; | ||
645 | 47 | } | ||
646 | 48 | |||
647 | 49 | ProjectExplorer::BuildStep *SnapcraftBuildStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) | ||
648 | 50 | { | ||
649 | 51 | Core::Id id = product->id(); | ||
650 | 52 | if (!Utils::contains(availableSteps(parent), [&id](const ProjectExplorer::BuildStepInfo &step){return id == step.id;})) | ||
651 | 53 | return nullptr; | ||
652 | 54 | |||
653 | 55 | if (id == Constants::SNAPCRAFT_RSYNCBUILSSTEP_ID) { | ||
654 | 56 | return new SnapcraftRsyncStep(parent, static_cast<SnapcraftRsyncStep *>(product)); | ||
655 | 57 | } else if (id == Constants::SNAPCRAFT_BUILDSTEP_ID) { | ||
656 | 58 | return new SnapcraftStep(parent, static_cast<SnapcraftStep *>(product)); | ||
657 | 59 | } | ||
658 | 60 | |||
659 | 61 | return nullptr; | ||
660 | 62 | } | ||
661 | 63 | |||
662 | 64 | } // namespace Internal | ||
663 | 65 | } // namespace Ubuntu | ||
664 | 0 | 66 | ||
665 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildstepfactory.h' | |||
666 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildstepfactory.h 1970-01-01 00:00:00 +0000 | |||
667 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftbuildstepfactory.h 2016-10-18 07:57:32 +0000 | |||
668 | @@ -0,0 +1,25 @@ | |||
669 | 1 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTBUILDSTEPFACTORY_H | ||
670 | 2 | #define UBUNTU_INTERNAL_SNAPCRAFTBUILDSTEPFACTORY_H | ||
671 | 3 | |||
672 | 4 | #include <projectexplorer/buildstep.h> | ||
673 | 5 | |||
674 | 6 | namespace Ubuntu { | ||
675 | 7 | namespace Internal { | ||
676 | 8 | |||
677 | 9 | class SnapcraftBuildStepFactory : public ProjectExplorer::IBuildStepFactory | ||
678 | 10 | { | ||
679 | 11 | Q_OBJECT | ||
680 | 12 | public: | ||
681 | 13 | SnapcraftBuildStepFactory(QObject *parent = nullptr); | ||
682 | 14 | |||
683 | 15 | // IBuildStepFactory interface | ||
684 | 16 | public: | ||
685 | 17 | virtual QList<ProjectExplorer::BuildStepInfo> availableSteps(ProjectExplorer::BuildStepList *parent) const override; | ||
686 | 18 | virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id) override; | ||
687 | 19 | virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override; | ||
688 | 20 | }; | ||
689 | 21 | |||
690 | 22 | } // namespace Internal | ||
691 | 23 | } // namespace Ubuntu | ||
692 | 24 | |||
693 | 25 | #endif // UBUNTU_INTERNAL_SNAPCRAFTBUILDSTEPFACTORY_H | ||
694 | 0 | 26 | ||
695 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftproject.cpp' | |||
696 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftproject.cpp 1970-01-01 00:00:00 +0000 | |||
697 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftproject.cpp 2016-10-18 07:57:32 +0000 | |||
698 | @@ -0,0 +1,156 @@ | |||
699 | 1 | /* | ||
700 | 2 | * Copyright 2016 Canonical Ltd. | ||
701 | 3 | * | ||
702 | 4 | * This program is free software; you can redistribute it and/or modify | ||
703 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
704 | 6 | * the Free Software Foundation; version 2.1. | ||
705 | 7 | * | ||
706 | 8 | * This program is distributed in the hope that it will be useful, | ||
707 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
708 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
709 | 11 | * GNU Lesser General Public License for more details. | ||
710 | 12 | * | ||
711 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
712 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
713 | 15 | * | ||
714 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
715 | 17 | */ | ||
716 | 18 | |||
717 | 19 | #include "snapcraftproject.h" | ||
718 | 20 | #include "snapcraftprojectnode.h" | ||
719 | 21 | |||
720 | 22 | #include <coreplugin/modemanager.h> | ||
721 | 23 | #include <coreplugin/icontext.h> | ||
722 | 24 | #include <coreplugin/documentmanager.h> | ||
723 | 25 | #include <projectexplorer/projectexplorerconstants.h> | ||
724 | 26 | #include <projectexplorer/kitinformation.h> | ||
725 | 27 | #include <projectexplorer/toolchain.h> | ||
726 | 28 | #include <projectexplorer/projectmacroexpander.h> | ||
727 | 29 | #include <qmljs/qmljssimplereader.h> | ||
728 | 30 | #include <qtsupport/qtkitinformation.h> | ||
729 | 31 | #include <qtsupport/qtsupportconstants.h> | ||
730 | 32 | |||
731 | 33 | #pragma GCC diagnostic push | ||
732 | 34 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
733 | 35 | #include <yaml-cpp/yaml.h> | ||
734 | 36 | #pragma GCC diagnostic pop | ||
735 | 37 | |||
736 | 38 | |||
737 | 39 | using namespace Ubuntu; | ||
738 | 40 | using namespace Ubuntu::Internal; | ||
739 | 41 | |||
740 | 42 | SnapcraftProject::SnapcraftProject(SnapcraftProjectManager *manager, const Utils::FileName &fileName) | ||
741 | 43 | : m_manager(manager), | ||
742 | 44 | m_fileName(fileName), | ||
743 | 45 | m_watcher(new QFileSystemWatcher) | ||
744 | 46 | { | ||
745 | 47 | |||
746 | 48 | setId(Constants::SNAPCRAFT_PROJECT_ID); | ||
747 | 49 | |||
748 | 50 | setProjectContext(Core::Context(Constants::SNAPCRAFT_PROJECT_PROJECTCONTEXT)); | ||
749 | 51 | |||
750 | 52 | |||
751 | 53 | m_file = QPointer<SnapcraftProjectFile>(new SnapcraftProjectFile()); | ||
752 | 54 | Core::DocumentManager::addDocument(m_file.data(), true); | ||
753 | 55 | setDocument(m_file.data()); | ||
754 | 56 | |||
755 | 57 | m_file->setFilePath(fileName); | ||
756 | 58 | |||
757 | 59 | m_rootNode = QSharedPointer<SnapcraftProjectNode>(new SnapcraftProjectNode(this, fileName, &m_watcher)); | ||
758 | 60 | |||
759 | 61 | ProjectExplorer::FileNode *projectFileNode = new ProjectExplorer::FileNode(fileName, ProjectExplorer::ProjectFileType, false); | ||
760 | 62 | m_rootNode->addFileNodes({projectFileNode}); | ||
761 | 63 | |||
762 | 64 | connect(m_file, &SnapcraftProjectFile::changed, this, &SnapcraftProject::asyncUpdate); | ||
763 | 65 | |||
764 | 66 | //we show magic directories that are not listed in the snapcraft.yaml file, therefore we need to watch the directory | ||
765 | 67 | //if one of those is changed or removed | ||
766 | 68 | m_watcher.addPath(projectDirectory().toFileInfo().absoluteFilePath()); | ||
767 | 69 | connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &SnapcraftProject::maybeUpdate); | ||
768 | 70 | |||
769 | 71 | QMetaObject::invokeMethod(this, "asyncUpdate", Qt::QueuedConnection); | ||
770 | 72 | } | ||
771 | 73 | |||
772 | 74 | QString SnapcraftProject::displayName() const { | ||
773 | 75 | return m_rootNode->displayName(); | ||
774 | 76 | } | ||
775 | 77 | |||
776 | 78 | ProjectExplorer::IProjectManager *SnapcraftProject::projectManager() const { | ||
777 | 79 | return m_manager; | ||
778 | 80 | } | ||
779 | 81 | |||
780 | 82 | ProjectExplorer::ProjectNode *SnapcraftProject::rootProjectNode() const { | ||
781 | 83 | return m_rootNode.data(); | ||
782 | 84 | } | ||
783 | 85 | |||
784 | 86 | QStringList SnapcraftProject::files(FilesMode) const { | ||
785 | 87 | QStringList files; | ||
786 | 88 | //enumChild(projectDir(), files); | ||
787 | 89 | return files; | ||
788 | 90 | } | ||
789 | 91 | |||
790 | 92 | bool SnapcraftProject::supportsKit(ProjectExplorer::Kit *, QString *) const | ||
791 | 93 | { | ||
792 | 94 | #if 0 | ||
793 | 95 | UbuntuKitMatcher matcher; | ||
794 | 96 | if (!matcher.matches(k)) { | ||
795 | 97 | if(errorMessage) | ||
796 | 98 | *errorMessage = tr("Only Desktop and Ubuntu Kits are supported"); | ||
797 | 99 | return false; | ||
798 | 100 | } | ||
799 | 101 | #endif | ||
800 | 102 | return true; | ||
801 | 103 | } | ||
802 | 104 | |||
803 | 105 | bool SnapcraftProject::needsConfiguration() const | ||
804 | 106 | { | ||
805 | 107 | return targets().size() == 0; | ||
806 | 108 | } | ||
807 | 109 | |||
808 | 110 | bool SnapcraftProject::requiresTargetPanel() const | ||
809 | 111 | { | ||
810 | 112 | return true; | ||
811 | 113 | } | ||
812 | 114 | |||
813 | 115 | QString SnapcraftProject::shadowBuildDirectory(const QString &proFilePath | ||
814 | 116 | , const ProjectExplorer::Kit *k | ||
815 | 117 | , const QString &suffix | ||
816 | 118 | , const ProjectExplorer::BuildConfiguration::BuildType buildType) | ||
817 | 119 | { | ||
818 | 120 | if (proFilePath.isEmpty()) | ||
819 | 121 | return QString(); | ||
820 | 122 | |||
821 | 123 | QFileInfo info(proFilePath); | ||
822 | 124 | |||
823 | 125 | QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k); | ||
824 | 126 | if (version) | ||
825 | 127 | return info.absolutePath(); | ||
826 | 128 | |||
827 | 129 | const QString projectName = QFileInfo(proFilePath).completeBaseName(); | ||
828 | 130 | ProjectExplorer::ProjectMacroExpander expander(proFilePath, projectName, k, suffix, buildType); | ||
829 | 131 | QDir projectDir = QDir(projectDirectory(Utils::FileName::fromString(proFilePath)).toString()); | ||
830 | 132 | QString buildPath = expander.expand(Core::DocumentManager::buildDirectory()); | ||
831 | 133 | return QDir::cleanPath(projectDir.absoluteFilePath(buildPath)); | ||
832 | 134 | } | ||
833 | 135 | |||
834 | 136 | void SnapcraftProject::asyncUpdate() | ||
835 | 137 | { | ||
836 | 138 | qDebug()<<"Syncing from yaml"; | ||
837 | 139 | try { | ||
838 | 140 | YAML::Node yaml = YAML::LoadFile(m_fileName.toString().toStdString()); | ||
839 | 141 | if (!m_rootNode->syncFromYAMLNode(yaml)) { | ||
840 | 142 | qDebug()<<"Invalid YAML file"; | ||
841 | 143 | } | ||
842 | 144 | } catch (const YAML::Exception &e) { | ||
843 | 145 | qDebug() << e.what(); | ||
844 | 146 | } | ||
845 | 147 | |||
846 | 148 | emit displayNameChanged(); | ||
847 | 149 | } | ||
848 | 150 | |||
849 | 151 | void SnapcraftProject::maybeUpdate(const QString &pathChanged) | ||
850 | 152 | { | ||
851 | 153 | if (QFileInfo(pathChanged) == projectDirectory().toFileInfo()) { | ||
852 | 154 | asyncUpdate(); | ||
853 | 155 | } | ||
854 | 156 | } | ||
855 | 0 | 157 | ||
856 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftproject.h' | |||
857 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftproject.h 1970-01-01 00:00:00 +0000 | |||
858 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftproject.h 2016-10-18 07:57:32 +0000 | |||
859 | @@ -0,0 +1,88 @@ | |||
860 | 1 | /* | ||
861 | 2 | * Copyright 2016 Canonical Ltd. | ||
862 | 3 | * | ||
863 | 4 | * This program is free software; you can redistribute it and/or modify | ||
864 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
865 | 6 | * the Free Software Foundation; version 2.1. | ||
866 | 7 | * | ||
867 | 8 | * This program is distributed in the hope that it will be useful, | ||
868 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
869 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
870 | 11 | * GNU Lesser General Public License for more details. | ||
871 | 12 | * | ||
872 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
873 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
874 | 15 | * | ||
875 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
876 | 17 | */ | ||
877 | 18 | |||
878 | 19 | #ifndef SNAPCRAFTPROJECT_H | ||
879 | 20 | #define SNAPCRAFTPROJECT_H | ||
880 | 21 | |||
881 | 22 | #include "snapcraftprojectmanager.h" | ||
882 | 23 | #include "snapcraftprojectfile.h" | ||
883 | 24 | |||
884 | 25 | #include <ubuntu/ubuntuconstants.h> | ||
885 | 26 | |||
886 | 27 | #include <projectexplorer/buildconfiguration.h> | ||
887 | 28 | #include <projectexplorer/projectnodes.h> | ||
888 | 29 | #include <projectexplorer/project.h> | ||
889 | 30 | |||
890 | 31 | #include <QPointer> | ||
891 | 32 | #include <QFileSystemWatcher> | ||
892 | 33 | |||
893 | 34 | #include <yaml-cpp/node/node.h> | ||
894 | 35 | |||
895 | 36 | namespace Ubuntu { | ||
896 | 37 | namespace Internal { | ||
897 | 38 | |||
898 | 39 | class UbuntuProjectManager; | ||
899 | 40 | class SnapcraftProjectNode; | ||
900 | 41 | |||
901 | 42 | class SnapcraftProject : public ProjectExplorer::Project | ||
902 | 43 | { | ||
903 | 44 | Q_OBJECT | ||
904 | 45 | |||
905 | 46 | public: | ||
906 | 47 | SnapcraftProject(SnapcraftProjectManager *manager, const Utils::FileName &fileName); | ||
907 | 48 | |||
908 | 49 | QString displayName() const override; | ||
909 | 50 | ProjectExplorer::IProjectManager *projectManager() const override; | ||
910 | 51 | |||
911 | 52 | ProjectExplorer::ProjectNode *rootProjectNode() const override; | ||
912 | 53 | QStringList files(FilesMode fileMode) const override; | ||
913 | 54 | |||
914 | 55 | QDir projectDir() const { | ||
915 | 56 | return projectDirectory().toString(); | ||
916 | 57 | } | ||
917 | 58 | |||
918 | 59 | QString filesFileName() const { | ||
919 | 60 | return m_fileName.toString(); | ||
920 | 61 | } | ||
921 | 62 | |||
922 | 63 | // Project interface | ||
923 | 64 | bool supportsKit(ProjectExplorer::Kit *k, QString *errorMessage) const override; | ||
924 | 65 | bool needsConfiguration() const override; | ||
925 | 66 | bool requiresTargetPanel() const override; | ||
926 | 67 | |||
927 | 68 | static QString shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k, | ||
928 | 69 | const QString &suffix = QString(), | ||
929 | 70 | const ProjectExplorer::BuildConfiguration::BuildType buildType = ProjectExplorer::BuildConfiguration::Unknown); | ||
930 | 71 | |||
931 | 72 | protected slots: | ||
932 | 73 | void asyncUpdate (); | ||
933 | 74 | void maybeUpdate (const QString &pathChanged); | ||
934 | 75 | |||
935 | 76 | private: | ||
936 | 77 | SnapcraftProjectManager *m_manager; | ||
937 | 78 | QString m_projectName; | ||
938 | 79 | QPointer<SnapcraftProjectFile> m_file; | ||
939 | 80 | |||
940 | 81 | Utils::FileName m_fileName; | ||
941 | 82 | QSharedPointer<SnapcraftProjectNode> m_rootNode; | ||
942 | 83 | QFileSystemWatcher m_watcher; | ||
943 | 84 | }; | ||
944 | 85 | } | ||
945 | 86 | } | ||
946 | 87 | |||
947 | 88 | #endif // SNAPCRAFTPROJECT_H | ||
948 | 0 | 89 | ||
949 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectfile.cpp' | |||
950 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectfile.cpp 1970-01-01 00:00:00 +0000 | |||
951 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectfile.cpp 2016-10-18 07:57:32 +0000 | |||
952 | @@ -0,0 +1,42 @@ | |||
953 | 1 | /* | ||
954 | 2 | * Copyright 2016 Canonical Ltd. | ||
955 | 3 | * | ||
956 | 4 | * This program is free software; you can redistribute it and/or modify | ||
957 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
958 | 6 | * the Free Software Foundation; version 2.1. | ||
959 | 7 | * | ||
960 | 8 | * This program is distributed in the hope that it will be useful, | ||
961 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
962 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
963 | 11 | * GNU Lesser General Public License for more details. | ||
964 | 12 | * | ||
965 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
966 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
967 | 15 | * | ||
968 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
969 | 17 | */ | ||
970 | 18 | |||
971 | 19 | #include "snapcraftprojectfile.h" | ||
972 | 20 | |||
973 | 21 | using namespace Ubuntu::Internal; | ||
974 | 22 | |||
975 | 23 | SnapcraftProjectFile::SnapcraftProjectFile(Core::Id id) | ||
976 | 24 | : TextEditor::TextDocument(id) | ||
977 | 25 | { | ||
978 | 26 | } | ||
979 | 27 | |||
980 | 28 | Core::IDocument::ReloadBehavior SnapcraftProjectFile::reloadBehavior(Core::IDocument::ChangeTrigger state, Core::IDocument::ChangeType type) const | ||
981 | 29 | { | ||
982 | 30 | Q_UNUSED(state) | ||
983 | 31 | Q_UNUSED(type) | ||
984 | 32 | return BehaviorSilent; | ||
985 | 33 | } | ||
986 | 34 | |||
987 | 35 | bool SnapcraftProjectFile::reload(QString *errorString, Core::IDocument::ReloadFlag flag, Core::IDocument::ChangeType type) | ||
988 | 36 | { | ||
989 | 37 | if (type != TypePermissions) { | ||
990 | 38 | emit changed(); | ||
991 | 39 | } | ||
992 | 40 | |||
993 | 41 | return TextDocument::reload(errorString, flag, type); | ||
994 | 42 | } | ||
995 | 0 | 43 | ||
996 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectfile.h' | |||
997 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectfile.h 1970-01-01 00:00:00 +0000 | |||
998 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectfile.h 2016-10-18 07:57:32 +0000 | |||
999 | @@ -0,0 +1,48 @@ | |||
1000 | 1 | /* | ||
1001 | 2 | * Copyright 2016 Canonical Ltd. | ||
1002 | 3 | * | ||
1003 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1004 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1005 | 6 | * the Free Software Foundation; version 2.1. | ||
1006 | 7 | * | ||
1007 | 8 | * This program is distributed in the hope that it will be useful, | ||
1008 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1009 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1010 | 11 | * GNU Lesser General Public License for more details. | ||
1011 | 12 | * | ||
1012 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1013 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1014 | 15 | * | ||
1015 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
1016 | 17 | */ | ||
1017 | 18 | |||
1018 | 19 | #ifndef SNAPCRAFTPROJECTFILE_H | ||
1019 | 20 | #define SNAPCRAFTPROJECTFILE_H | ||
1020 | 21 | |||
1021 | 22 | #include <QObject> | ||
1022 | 23 | #include <ubuntu/ubuntuconstants.h> | ||
1023 | 24 | |||
1024 | 25 | #include <texteditor/textdocument.h> | ||
1025 | 26 | #include <utils/fileutils.h> | ||
1026 | 27 | |||
1027 | 28 | namespace Ubuntu { | ||
1028 | 29 | namespace Internal { | ||
1029 | 30 | class SnapcraftProject; | ||
1030 | 31 | class SnapcraftProjectFile : public TextEditor::TextDocument | ||
1031 | 32 | { | ||
1032 | 33 | Q_OBJECT | ||
1033 | 34 | public: | ||
1034 | 35 | SnapcraftProjectFile(Core::Id id = Core::Id()); | ||
1035 | 36 | |||
1036 | 37 | // IDocument interface | ||
1037 | 38 | virtual ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override; | ||
1038 | 39 | virtual bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; | ||
1039 | 40 | |||
1040 | 41 | signals: | ||
1041 | 42 | void changed (); | ||
1042 | 43 | |||
1043 | 44 | }; | ||
1044 | 45 | } | ||
1045 | 46 | } | ||
1046 | 47 | |||
1047 | 48 | #endif // SNAPCRAFTPROJECTFILE_H | ||
1048 | 0 | 49 | ||
1049 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectmanager.cpp' | |||
1050 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectmanager.cpp 1970-01-01 00:00:00 +0000 | |||
1051 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectmanager.cpp 2016-10-18 07:57:32 +0000 | |||
1052 | @@ -0,0 +1,64 @@ | |||
1053 | 1 | /* | ||
1054 | 2 | * Copyright 2016 Canonical Ltd. | ||
1055 | 3 | * | ||
1056 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1057 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1058 | 6 | * the Free Software Foundation; version 2.1. | ||
1059 | 7 | * | ||
1060 | 8 | * This program is distributed in the hope that it will be useful, | ||
1061 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1062 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1063 | 11 | * GNU Lesser General Public License for more details. | ||
1064 | 12 | * | ||
1065 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1066 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1067 | 15 | * | ||
1068 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
1069 | 17 | */ | ||
1070 | 18 | |||
1071 | 19 | #include "snapcraftprojectmanager.h" | ||
1072 | 20 | #include "snapcraftproject.h" | ||
1073 | 21 | |||
1074 | 22 | #include <ubuntu/ubuntuconstants.h> | ||
1075 | 23 | |||
1076 | 24 | #include <projectexplorer/session.h> | ||
1077 | 25 | #include <coreplugin/idocument.h> | ||
1078 | 26 | #include <utils/fileutils.h> | ||
1079 | 27 | |||
1080 | 28 | #include <QFileInfo> | ||
1081 | 29 | |||
1082 | 30 | |||
1083 | 31 | namespace Ubuntu { | ||
1084 | 32 | namespace Internal { | ||
1085 | 33 | |||
1086 | 34 | SnapcraftProjectManager::SnapcraftProjectManager() | ||
1087 | 35 | { | ||
1088 | 36 | |||
1089 | 37 | } | ||
1090 | 38 | |||
1091 | 39 | QString SnapcraftProjectManager::mimeType() const | ||
1092 | 40 | { | ||
1093 | 41 | return QLatin1String(Constants::SNAPCRAFT_PROJECT_MIMETYPE); | ||
1094 | 42 | } | ||
1095 | 43 | |||
1096 | 44 | ProjectExplorer::Project *SnapcraftProjectManager::openProject(const QString &fileName, QString *errorString) | ||
1097 | 45 | { | ||
1098 | 46 | QFileInfo fileInfo(fileName); | ||
1099 | 47 | |||
1100 | 48 | foreach (ProjectExplorer::Project *pi, ProjectExplorer::SessionManager::projects()) { | ||
1101 | 49 | if (fileName == pi->document()->filePath().toString()) { | ||
1102 | 50 | if (errorString) | ||
1103 | 51 | *errorString = tr("Failed opening project '%1': Project already open") .arg(QDir::toNativeSeparators(fileName)); | ||
1104 | 52 | return 0; | ||
1105 | 53 | } | ||
1106 | 54 | } | ||
1107 | 55 | |||
1108 | 56 | if (fileInfo.isFile()) | ||
1109 | 57 | return new SnapcraftProject(this, Utils::FileName(fileInfo)); | ||
1110 | 58 | |||
1111 | 59 | *errorString = tr("Failed opening project '%1': Project file is not a file").arg(QDir::toNativeSeparators(fileName)); | ||
1112 | 60 | return 0; | ||
1113 | 61 | } | ||
1114 | 62 | |||
1115 | 63 | } // namespace Internal | ||
1116 | 64 | } // namespace Ubuntu | ||
1117 | 0 | 65 | ||
1118 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectmanager.h' | |||
1119 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectmanager.h 1970-01-01 00:00:00 +0000 | |||
1120 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectmanager.h 2016-10-18 07:57:32 +0000 | |||
1121 | @@ -0,0 +1,40 @@ | |||
1122 | 1 | /* | ||
1123 | 2 | * Copyright 2016 Canonical Ltd. | ||
1124 | 3 | * | ||
1125 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1126 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1127 | 6 | * the Free Software Foundation; version 2.1. | ||
1128 | 7 | * | ||
1129 | 8 | * This program is distributed in the hope that it will be useful, | ||
1130 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1131 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1132 | 11 | * GNU Lesser General Public License for more details. | ||
1133 | 12 | * | ||
1134 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1135 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1136 | 15 | * | ||
1137 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
1138 | 17 | */ | ||
1139 | 18 | |||
1140 | 19 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTPROJECTMANAGER_H | ||
1141 | 20 | #define UBUNTU_INTERNAL_SNAPCRAFTPROJECTMANAGER_H | ||
1142 | 21 | |||
1143 | 22 | #include <projectexplorer/iprojectmanager.h> | ||
1144 | 23 | |||
1145 | 24 | namespace Ubuntu { | ||
1146 | 25 | namespace Internal { | ||
1147 | 26 | |||
1148 | 27 | class SnapcraftProjectManager : public ProjectExplorer::IProjectManager | ||
1149 | 28 | { | ||
1150 | 29 | public: | ||
1151 | 30 | SnapcraftProjectManager(); | ||
1152 | 31 | |||
1153 | 32 | // IProjectManager interface | ||
1154 | 33 | virtual QString mimeType() const override; | ||
1155 | 34 | virtual ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString) override; | ||
1156 | 35 | }; | ||
1157 | 36 | |||
1158 | 37 | } // namespace Internal | ||
1159 | 38 | } // namespace Ubuntu | ||
1160 | 39 | |||
1161 | 40 | #endif // UBUNTU_INTERNAL_SNAPCRAFTPROJECTMANAGER_H | ||
1162 | 0 | 41 | ||
1163 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp' | |||
1164 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp 1970-01-01 00:00:00 +0000 | |||
1165 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp 2016-10-18 07:57:32 +0000 | |||
1166 | @@ -0,0 +1,496 @@ | |||
1167 | 1 | /* | ||
1168 | 2 | * Copyright 2016 Canonical Ltd. | ||
1169 | 3 | * | ||
1170 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1171 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1172 | 6 | * the Free Software Foundation; version 2.1. | ||
1173 | 7 | * | ||
1174 | 8 | * This program is distributed in the hope that it will be useful, | ||
1175 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1176 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1177 | 11 | * GNU Lesser General Public License for more details. | ||
1178 | 12 | * | ||
1179 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1180 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1181 | 15 | * | ||
1182 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
1183 | 17 | */ | ||
1184 | 18 | |||
1185 | 19 | #include "snapcraftprojectnode.h" | ||
1186 | 20 | |||
1187 | 21 | #include <projectexplorer/nodesvisitor.h> | ||
1188 | 22 | #include <coreplugin/fileiconprovider.h> | ||
1189 | 23 | #include <ubuntu/ubuntuconstants.h> | ||
1190 | 24 | |||
1191 | 25 | #include <QFileInfo> | ||
1192 | 26 | #include <QDir> | ||
1193 | 27 | #include <QTimer> | ||
1194 | 28 | #include <QFileSystemWatcher> | ||
1195 | 29 | |||
1196 | 30 | #pragma GCC diagnostic push | ||
1197 | 31 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
1198 | 32 | #include <yaml-cpp/yaml.h> | ||
1199 | 33 | #pragma GCC diagnostic pop | ||
1200 | 34 | |||
1201 | 35 | namespace Ubuntu { | ||
1202 | 36 | namespace Internal { | ||
1203 | 37 | |||
1204 | 38 | static QIcon generateIcon(const QString &overlay) { | ||
1205 | 39 | const QSize desiredSize = QSize(16, 16); | ||
1206 | 40 | |||
1207 | 41 | const QPixmap overlayPixmap(overlay); | ||
1208 | 42 | const QIcon overlayIcon(overlayPixmap.scaled(12, 12)); | ||
1209 | 43 | const QPixmap pixmap | ||
1210 | 44 | = Core::FileIconProvider::overlayIcon(QStyle::SP_DirIcon, overlayIcon, desiredSize); | ||
1211 | 45 | |||
1212 | 46 | QIcon result; | ||
1213 | 47 | result.addPixmap(pixmap); | ||
1214 | 48 | |||
1215 | 49 | return result; | ||
1216 | 50 | } | ||
1217 | 51 | |||
1218 | 52 | static QIcon generateProjectIcon () { | ||
1219 | 53 | static QIcon projectIcon; | ||
1220 | 54 | if (projectIcon.isNull()) | ||
1221 | 55 | projectIcon = generateIcon(QString::fromLatin1(Constants::UBUNTU_ICON)); | ||
1222 | 56 | |||
1223 | 57 | return projectIcon; | ||
1224 | 58 | } | ||
1225 | 59 | |||
1226 | 60 | SnapcraftProjectNode::SnapcraftProjectNode(SnapcraftProject *rootProject, const Utils::FileName &projectFilePath, QFileSystemWatcher *watcher) | ||
1227 | 61 | : ProjectExplorer::ProjectNode (projectFilePath), | ||
1228 | 62 | m_rootProject(rootProject), | ||
1229 | 63 | m_watcher(watcher) | ||
1230 | 64 | { | ||
1231 | 65 | setDisplayName(projectFilePath.parentDir().toString()); | ||
1232 | 66 | setIcon(generateProjectIcon()); | ||
1233 | 67 | } | ||
1234 | 68 | |||
1235 | 69 | SnapcraftProjectNode::~SnapcraftProjectNode() | ||
1236 | 70 | { | ||
1237 | 71 | if (m_watcher) { | ||
1238 | 72 | |||
1239 | 73 | } | ||
1240 | 74 | } | ||
1241 | 75 | |||
1242 | 76 | bool SnapcraftProjectNode::syncFromYAMLNode(YAML::Node rootNode) | ||
1243 | 77 | { | ||
1244 | 78 | qDebug()<<"Sync from YAML node"; | ||
1245 | 79 | try { | ||
1246 | 80 | QString displayName = QString::fromStdString(rootNode["name"].as<std::string>()); | ||
1247 | 81 | setDisplayName(displayName); | ||
1248 | 82 | |||
1249 | 83 | YAML::Node parts = rootNode["parts"]; | ||
1250 | 84 | if (!parts.IsMap()) { | ||
1251 | 85 | qDebug()<<"Parts is not a map"; | ||
1252 | 86 | return false; | ||
1253 | 87 | } | ||
1254 | 88 | |||
1255 | 89 | QList<ProjectExplorer::FolderNode *> existingNodes = subFolderNodes(); | ||
1256 | 90 | QList<ProjectExplorer::FolderNode *> nodesToRemove; | ||
1257 | 91 | QList<ProjectExplorer::FolderNode *> nodesToAdd; | ||
1258 | 92 | |||
1259 | 93 | QStringList partsFromYaml; | ||
1260 | 94 | QStringList existingParts; | ||
1261 | 95 | |||
1262 | 96 | for (const auto &part : existingNodes) { | ||
1263 | 97 | existingParts << part->displayName(); | ||
1264 | 98 | } | ||
1265 | 99 | |||
1266 | 100 | //iterate over the parts | ||
1267 | 101 | for (auto it = parts.begin(); it != parts.end(); ++it) { | ||
1268 | 102 | |||
1269 | 103 | YAML::Node subProject = it->second; | ||
1270 | 104 | QString partName = QString::fromStdString(it->first.as<std::string>()); | ||
1271 | 105 | //QString subType = QString::fromStdString(subProject["plugin"].as<std::string>()); | ||
1272 | 106 | QString source = QDir::cleanPath(QString::fromStdString(subProject["source"].as<std::string>())); | ||
1273 | 107 | |||
1274 | 108 | partsFromYaml << partName; | ||
1275 | 109 | |||
1276 | 110 | // We only show a part if it locally exists and is a directory | ||
1277 | 111 | QString sourcePathName = QDir::cleanPath(filePath().parentDir().appendPath(source).toString()); | ||
1278 | 112 | Utils::FileName sourcePath = Utils::FileName::fromString(sourcePathName); | ||
1279 | 113 | if (sourcePath.exists() && sourcePath.toFileInfo().isDir()) { | ||
1280 | 114 | |||
1281 | 115 | int idx = existingParts.indexOf(partName); | ||
1282 | 116 | if (idx >= 0) { | ||
1283 | 117 | //check if source is still the same | ||
1284 | 118 | SnapcraftGenericPartNode *n = static_cast<SnapcraftGenericPartNode *>(existingNodes.at(idx)); | ||
1285 | 119 | if (n->filePath() == sourcePath) | ||
1286 | 120 | continue; | ||
1287 | 121 | |||
1288 | 122 | nodesToRemove << n; | ||
1289 | 123 | } | ||
1290 | 124 | |||
1291 | 125 | SnapcraftGenericPartNode *partNode = new SnapcraftGenericPartNode(partName, sourcePath, m_watcher); | ||
1292 | 126 | nodesToAdd << partNode; | ||
1293 | 127 | } | ||
1294 | 128 | } | ||
1295 | 129 | |||
1296 | 130 | |||
1297 | 131 | //snapcraft has magic directories, like setup, we want to show in the project tree | ||
1298 | 132 | QStringList magicSnapcraftDirs{ | ||
1299 | 133 | QStringLiteral("setup") | ||
1300 | 134 | }; | ||
1301 | 135 | |||
1302 | 136 | for (const QString &magicDir: magicSnapcraftDirs) { | ||
1303 | 137 | Utils::FileName dirPath = filePath().parentDir().appendPath(magicDir); | ||
1304 | 138 | if (dirPath.exists()) { | ||
1305 | 139 | partsFromYaml << magicDir; | ||
1306 | 140 | if(!existingParts.contains(magicDir)) { | ||
1307 | 141 | SnapcraftGenericPartNode *partNode = new SnapcraftGenericPartNode(magicDir, dirPath, m_watcher); | ||
1308 | 142 | nodesToAdd << partNode; | ||
1309 | 143 | } | ||
1310 | 144 | } | ||
1311 | 145 | } | ||
1312 | 146 | |||
1313 | 147 | QSet<QString> obsoleteParts = existingParts.toSet() - partsFromYaml.toSet(); | ||
1314 | 148 | qDebug()<<"Parts in yaml"<<partsFromYaml; | ||
1315 | 149 | qDebug()<<"Currently known parts"<<existingParts; | ||
1316 | 150 | qDebug()<<"Parts now obsolete: "<<obsoleteParts; | ||
1317 | 151 | for (const auto &part : obsoleteParts) { | ||
1318 | 152 | int idx = existingParts.indexOf(part); | ||
1319 | 153 | if (idx >= 0) | ||
1320 | 154 | nodesToRemove << existingNodes.at(idx); | ||
1321 | 155 | } | ||
1322 | 156 | |||
1323 | 157 | //remove old nodes | ||
1324 | 158 | removeFolderNodes(nodesToRemove); | ||
1325 | 159 | addFolderNodes(nodesToAdd); | ||
1326 | 160 | } catch (const YAML::Exception &e) { | ||
1327 | 161 | qDebug()<<"ERRROR ERROR ERROR "<<e.what(); | ||
1328 | 162 | return false; | ||
1329 | 163 | } | ||
1330 | 164 | |||
1331 | 165 | return true; | ||
1332 | 166 | } | ||
1333 | 167 | |||
1334 | 168 | /*! | ||
1335 | 169 | \class Ubuntu::Internal::SnapcraftGenericPartNode | ||
1336 | 170 | \brief The SnapcraftGenericPartNode class | ||
1337 | 171 | Fallback node if the subproject type can not be handled by the plugin directly | ||
1338 | 172 | */ | ||
1339 | 173 | |||
1340 | 174 | static void enumChild(const QDir &dir, QSet<Utils::FileName> &dirs, QSet<Utils::FileName> &res) { | ||
1341 | 175 | foreach (const QFileInfo &info, dir.entryInfoList(QDir::NoDotAndDotDot|QDir::Dirs|QDir::Files|QDir::Hidden)) { | ||
1342 | 176 | if (info.isDir()) { | ||
1343 | 177 | dirs << Utils::FileName(info); | ||
1344 | 178 | enumChild(QDir(info.absoluteFilePath()), dirs, res); | ||
1345 | 179 | } else { | ||
1346 | 180 | res.insert(Utils::FileName(info)); | ||
1347 | 181 | } | ||
1348 | 182 | } | ||
1349 | 183 | } | ||
1350 | 184 | |||
1351 | 185 | SnapcraftGenericPartNode::SnapcraftGenericPartNode(const QString &partName, const Utils::FileName &folderPath, QFileSystemWatcher *watcher) | ||
1352 | 186 | : ProjectExplorer::FolderNode (folderPath, ProjectExplorer::FolderNodeType, partName) | ||
1353 | 187 | , m_watcher(watcher) | ||
1354 | 188 | { | ||
1355 | 189 | scheduleProjectScan(); | ||
1356 | 190 | |||
1357 | 191 | setIcon(generateProjectIcon()); | ||
1358 | 192 | |||
1359 | 193 | if (watcher->addPath(folderPath.toString())) { | ||
1360 | 194 | qDebug()<<"Added"<<folderPath.toString()<<"to watcher"; | ||
1361 | 195 | } else { | ||
1362 | 196 | qDebug()<<"Failed to add"<<folderPath.toString()<<"to watcher"; | ||
1363 | 197 | } | ||
1364 | 198 | m_watcherConnection = QObject::connect(watcher, &QFileSystemWatcher::directoryChanged, [this](const QString &path){ | ||
1365 | 199 | maybeScheduleProjectScan(path); | ||
1366 | 200 | }); | ||
1367 | 201 | } | ||
1368 | 202 | |||
1369 | 203 | SnapcraftGenericPartNode::~SnapcraftGenericPartNode() | ||
1370 | 204 | { | ||
1371 | 205 | //@BUG the watcher is still watching all the subdirs and files! | ||
1372 | 206 | if (m_watcher) { | ||
1373 | 207 | QString myPath = filePath().toFileInfo().absoluteFilePath(); | ||
1374 | 208 | QStringList watched = m_watcher->directories(); | ||
1375 | 209 | QStringList toRemove; | ||
1376 | 210 | for(const QString &path: watched) { | ||
1377 | 211 | if(path.startsWith(myPath)) | ||
1378 | 212 | toRemove << path; | ||
1379 | 213 | } | ||
1380 | 214 | m_watcher->removePaths(toRemove); | ||
1381 | 215 | QObject::disconnect(m_watcherConnection); | ||
1382 | 216 | } | ||
1383 | 217 | } | ||
1384 | 218 | |||
1385 | 219 | void SnapcraftGenericPartNode::maybeScheduleProjectScan(const QString &changedPath) | ||
1386 | 220 | { | ||
1387 | 221 | Utils::FileName changed = Utils::FileName::fromString(changedPath); | ||
1388 | 222 | if (filePath().toFileInfo() == changed.toFileInfo()) | ||
1389 | 223 | scheduleProjectScan(); | ||
1390 | 224 | } | ||
1391 | 225 | |||
1392 | 226 | void SnapcraftGenericPartNode::scheduleProjectScan() | ||
1393 | 227 | { | ||
1394 | 228 | if (m_scanning) | ||
1395 | 229 | return; | ||
1396 | 230 | |||
1397 | 231 | qDebug()<<"Scheduling Project scan"; | ||
1398 | 232 | |||
1399 | 233 | m_scanning = true; | ||
1400 | 234 | |||
1401 | 235 | QTimer *rescanTimer = new QTimer(); | ||
1402 | 236 | rescanTimer->setSingleShot(true); | ||
1403 | 237 | rescanTimer->start(0); | ||
1404 | 238 | QObject::connect(rescanTimer, &QTimer::timeout, [this, rescanTimer](){ | ||
1405 | 239 | qDebug()<<"Starting Project scan"; | ||
1406 | 240 | delete rescanTimer; | ||
1407 | 241 | this->scanProjectDirectory(); | ||
1408 | 242 | |||
1409 | 243 | m_scanning = false; | ||
1410 | 244 | }); | ||
1411 | 245 | } | ||
1412 | 246 | |||
1413 | 247 | void SnapcraftGenericPartNode::removeFileNodes(const QList<Utils::FileName> &files) | ||
1414 | 248 | { | ||
1415 | 249 | foreach(const Utils::FileName &f, files) { | ||
1416 | 250 | if(f.toFileInfo().isDir()) | ||
1417 | 251 | continue; | ||
1418 | 252 | |||
1419 | 253 | FindFileNodesForFileVisitor vis(f); | ||
1420 | 254 | this->accept(&vis); | ||
1421 | 255 | |||
1422 | 256 | for (ProjectExplorer::FileNode *node : vis.nodes()) { | ||
1423 | 257 | node->parentFolderNode()->removeFileNodes({node}); | ||
1424 | 258 | } | ||
1425 | 259 | } | ||
1426 | 260 | } | ||
1427 | 261 | |||
1428 | 262 | void SnapcraftGenericPartNode::removeFolderNodes(QList<Utils::FileName> &dirs) | ||
1429 | 263 | { | ||
1430 | 264 | |||
1431 | 265 | qSort(dirs.begin(), dirs.end(),[](const Utils::FileName &a, const Utils::FileName &b){ | ||
1432 | 266 | return a.toFileInfo().absoluteFilePath() > b.toFileInfo().absoluteFilePath(); | ||
1433 | 267 | }); | ||
1434 | 268 | |||
1435 | 269 | foreach(const Utils::FileName &f, dirs) { | ||
1436 | 270 | FindNodesForFolderVisitor vis(f); | ||
1437 | 271 | this->accept(&vis); | ||
1438 | 272 | |||
1439 | 273 | FindNodesForFolderVisitor visParent(f.parentDir()); | ||
1440 | 274 | this->accept(&visParent); | ||
1441 | 275 | |||
1442 | 276 | if(visParent.nodes().size()) { | ||
1443 | 277 | m_watcher->removePath(f.toFileInfo().absoluteFilePath()); | ||
1444 | 278 | visParent.nodes()[0]->removeFolderNodes(vis.nodes()); | ||
1445 | 279 | } | ||
1446 | 280 | } | ||
1447 | 281 | } | ||
1448 | 282 | |||
1449 | 283 | QList<ProjectExplorer::ProjectAction> SnapcraftGenericPartNode::supportedActions(ProjectExplorer::Node *node) const | ||
1450 | 284 | { | ||
1451 | 285 | static const QList<ProjectExplorer::ProjectAction> fileActions { | ||
1452 | 286 | ProjectExplorer::ProjectAction::Rename, | ||
1453 | 287 | ProjectExplorer::ProjectAction::RemoveFile | ||
1454 | 288 | }; | ||
1455 | 289 | static const QList<ProjectExplorer::ProjectAction> folderActions { | ||
1456 | 290 | ProjectExplorer::ProjectAction::AddNewFile, | ||
1457 | 291 | ProjectExplorer::ProjectAction::RemoveFile | ||
1458 | 292 | }; | ||
1459 | 293 | switch (node->nodeType()) { | ||
1460 | 294 | case ProjectExplorer::FileNodeType: | ||
1461 | 295 | return fileActions; | ||
1462 | 296 | case ProjectExplorer::FolderNodeType: | ||
1463 | 297 | case ProjectExplorer::ProjectNodeType: | ||
1464 | 298 | return folderActions; | ||
1465 | 299 | default: | ||
1466 | 300 | return ProjectExplorer::FolderNode::supportedActions(node); | ||
1467 | 301 | } | ||
1468 | 302 | } | ||
1469 | 303 | |||
1470 | 304 | bool SnapcraftGenericPartNode::addFiles(const QStringList &, QStringList *) | ||
1471 | 305 | { | ||
1472 | 306 | return true; | ||
1473 | 307 | } | ||
1474 | 308 | |||
1475 | 309 | bool SnapcraftGenericPartNode::removeFiles(const QStringList &, QStringList *) | ||
1476 | 310 | { | ||
1477 | 311 | return true; | ||
1478 | 312 | } | ||
1479 | 313 | |||
1480 | 314 | bool SnapcraftGenericPartNode::deleteFiles(const QStringList &) | ||
1481 | 315 | { | ||
1482 | 316 | return true; | ||
1483 | 317 | } | ||
1484 | 318 | |||
1485 | 319 | void SnapcraftGenericPartNode::scanProjectDirectory() | ||
1486 | 320 | { | ||
1487 | 321 | QSet<Utils::FileName> dirs; | ||
1488 | 322 | QSet<Utils::FileName> files; | ||
1489 | 323 | enumChild(QDir(filePath().toString()), dirs, files); | ||
1490 | 324 | |||
1491 | 325 | FindFilesAndDirsVisitor vis; | ||
1492 | 326 | this->accept(&vis); | ||
1493 | 327 | |||
1494 | 328 | QSet<Utils::FileName> oldFiles = QSet<Utils::FileName>::fromList(vis.filePaths()); | ||
1495 | 329 | QSet<Utils::FileName> oldDirs = QSet<Utils::FileName>::fromList(vis.dirPaths()); | ||
1496 | 330 | QSet<Utils::FileName> newFiles(files); | ||
1497 | 331 | QSet<Utils::FileName> newDirs(dirs); | ||
1498 | 332 | |||
1499 | 333 | QSet<Utils::FileName> filesToRemove = oldFiles - newFiles; | ||
1500 | 334 | QSet<Utils::FileName> filesToAdd = newFiles - oldFiles; | ||
1501 | 335 | QList<Utils::FileName> dirsToRemove = (oldDirs - newDirs).toList(); | ||
1502 | 336 | QSet<Utils::FileName> dirsToAdd = newDirs - oldDirs; | ||
1503 | 337 | |||
1504 | 338 | qDebug()<<"Removing dirs " <<dirsToRemove; | ||
1505 | 339 | qDebug()<<"Adding dirs " <<dirsToAdd; | ||
1506 | 340 | qDebug()<<"Removing files" <<filesToRemove; | ||
1507 | 341 | qDebug()<<"Adding files " <<filesToAdd; | ||
1508 | 342 | |||
1509 | 343 | removeFileNodes(filesToRemove.toList()); | ||
1510 | 344 | removeFolderNodes(dirsToRemove); | ||
1511 | 345 | |||
1512 | 346 | for (const Utils::FileName &dir : dirsToAdd) { | ||
1513 | 347 | Utils::FileName relativeName = dir.relativeChildPath(filePath()); | ||
1514 | 348 | QStringList relativeNameList = relativeName.toUserOutput().split(QDir::separator()); | ||
1515 | 349 | createOrFindFolder(relativeNameList); | ||
1516 | 350 | } | ||
1517 | 351 | |||
1518 | 352 | for (const Utils::FileName &file : filesToAdd) { | ||
1519 | 353 | Utils::FileName folderPath = file.parentDir(); | ||
1520 | 354 | |||
1521 | 355 | //do not show the project file twice | ||
1522 | 356 | if (file == projectNode()->filePath()) | ||
1523 | 357 | continue; | ||
1524 | 358 | |||
1525 | 359 | ProjectExplorer::FolderNode *parentNode = nullptr; | ||
1526 | 360 | if (folderPath == filePath()) { | ||
1527 | 361 | parentNode = this; | ||
1528 | 362 | } else { | ||
1529 | 363 | Utils::FileName relativeName = folderPath.relativeChildPath(filePath()); | ||
1530 | 364 | QStringList relativeNameList = relativeName.toUserOutput().split(QDir::separator()); | ||
1531 | 365 | parentNode = createOrFindFolder(relativeNameList); | ||
1532 | 366 | } | ||
1533 | 367 | |||
1534 | 368 | ProjectExplorer::FileNode *fNode = new ProjectExplorer::FileNode(file, ProjectExplorer::UnknownFileType, false); | ||
1535 | 369 | parentNode->addFileNodes({fNode}); | ||
1536 | 370 | } | ||
1537 | 371 | } | ||
1538 | 372 | |||
1539 | 373 | ProjectExplorer::FolderNode *SnapcraftGenericPartNode::createOrFindFolder(const QStringList &folder) | ||
1540 | 374 | { | ||
1541 | 375 | QStringList watches; | ||
1542 | 376 | ProjectExplorer::FolderNode *currFolder = this; | ||
1543 | 377 | |||
1544 | 378 | Utils::FileName currentPath = filePath(); | ||
1545 | 379 | |||
1546 | 380 | for (const QString &folderName: folder) { | ||
1547 | 381 | |||
1548 | 382 | QList<ProjectExplorer::FolderNode *> subnodes = currFolder->subFolderNodes(); | ||
1549 | 383 | currentPath = currentPath.appendPath(folderName); | ||
1550 | 384 | |||
1551 | 385 | auto check = [&folderName](ProjectExplorer::FolderNode *f) { | ||
1552 | 386 | return f->filePath().fileName() == folderName; | ||
1553 | 387 | }; | ||
1554 | 388 | |||
1555 | 389 | auto it = std::find_if(subnodes.begin(), subnodes.end(), check); | ||
1556 | 390 | |||
1557 | 391 | if (it != subnodes.end()) { | ||
1558 | 392 | //node exists already | ||
1559 | 393 | currFolder = *it; | ||
1560 | 394 | continue; | ||
1561 | 395 | } | ||
1562 | 396 | |||
1563 | 397 | //does not exist lets create a new one | ||
1564 | 398 | ProjectExplorer::FolderNode *fNode = new SnapcraftGenericPartFolderNode(currentPath, ProjectExplorer::FolderNodeType, folderName); | ||
1565 | 399 | currFolder->addFolderNodes({fNode}); | ||
1566 | 400 | currFolder = fNode; | ||
1567 | 401 | |||
1568 | 402 | watches << currentPath.toFileInfo().absoluteFilePath(); | ||
1569 | 403 | } | ||
1570 | 404 | qDebug()<<"Failed to add watches: "<<m_watcher->addPaths(watches); | ||
1571 | 405 | return currFolder; | ||
1572 | 406 | } | ||
1573 | 407 | |||
1574 | 408 | Utils::FileNameList FindFilesAndDirsVisitor::filePaths() const | ||
1575 | 409 | { | ||
1576 | 410 | return m_filePaths; | ||
1577 | 411 | } | ||
1578 | 412 | |||
1579 | 413 | Utils::FileNameList FindFilesAndDirsVisitor::dirPaths() const | ||
1580 | 414 | { | ||
1581 | 415 | return m_dirPaths; | ||
1582 | 416 | } | ||
1583 | 417 | |||
1584 | 418 | void FindFilesAndDirsVisitor::visitProjectNode(ProjectExplorer::ProjectNode *projectNode) | ||
1585 | 419 | { | ||
1586 | 420 | visitFolderNode(projectNode); | ||
1587 | 421 | } | ||
1588 | 422 | |||
1589 | 423 | void FindFilesAndDirsVisitor::visitFolderNode(ProjectExplorer::FolderNode *folderNode) | ||
1590 | 424 | { | ||
1591 | 425 | if (folderNode->nodeType() != ProjectExplorer::ProjectNodeType) | ||
1592 | 426 | m_dirPaths.append(folderNode->filePath()); | ||
1593 | 427 | |||
1594 | 428 | for (const ProjectExplorer::FileNode *fileNode : folderNode->fileNodes()) | ||
1595 | 429 | m_filePaths.append(fileNode->filePath()); | ||
1596 | 430 | } | ||
1597 | 431 | |||
1598 | 432 | FindFileNodesForFileVisitor::FindFileNodesForFileVisitor(const Utils::FileName &f) | ||
1599 | 433 | : m_file(f) | ||
1600 | 434 | { | ||
1601 | 435 | |||
1602 | 436 | } | ||
1603 | 437 | |||
1604 | 438 | QList<ProjectExplorer::FileNode *> FindFileNodesForFileVisitor::nodes() const | ||
1605 | 439 | { | ||
1606 | 440 | return m_nodes; | ||
1607 | 441 | } | ||
1608 | 442 | |||
1609 | 443 | void FindFileNodesForFileVisitor::visitProjectNode(ProjectExplorer::ProjectNode *projectNode) | ||
1610 | 444 | { | ||
1611 | 445 | visitFolderNode(projectNode); | ||
1612 | 446 | } | ||
1613 | 447 | |||
1614 | 448 | void FindFileNodesForFileVisitor::visitFolderNode(ProjectExplorer::FolderNode *folderNode) | ||
1615 | 449 | { | ||
1616 | 450 | for(auto fileNode: folderNode->fileNodes()) { | ||
1617 | 451 | if (fileNode->filePath() == m_file) | ||
1618 | 452 | m_nodes.append(fileNode); | ||
1619 | 453 | } | ||
1620 | 454 | } | ||
1621 | 455 | |||
1622 | 456 | FindNodesForFolderVisitor::FindNodesForFolderVisitor(const Utils::FileName &f) | ||
1623 | 457 | : m_folder(f) | ||
1624 | 458 | { | ||
1625 | 459 | |||
1626 | 460 | } | ||
1627 | 461 | |||
1628 | 462 | QList<ProjectExplorer::FolderNode *> FindNodesForFolderVisitor::nodes() const | ||
1629 | 463 | { | ||
1630 | 464 | return m_nodes; | ||
1631 | 465 | } | ||
1632 | 466 | |||
1633 | 467 | void FindNodesForFolderVisitor::visitProjectNode(ProjectExplorer::ProjectNode *) | ||
1634 | 468 | { | ||
1635 | 469 | return; | ||
1636 | 470 | } | ||
1637 | 471 | |||
1638 | 472 | void FindNodesForFolderVisitor::visitFolderNode(ProjectExplorer::FolderNode *folderNode) | ||
1639 | 473 | { | ||
1640 | 474 | if (m_folder == folderNode->filePath()) | ||
1641 | 475 | m_nodes.append(folderNode); | ||
1642 | 476 | } | ||
1643 | 477 | |||
1644 | 478 | bool SnapcraftGenericPartFolderNode::addFiles(const QStringList &, QStringList *) | ||
1645 | 479 | { | ||
1646 | 480 | return true; | ||
1647 | 481 | } | ||
1648 | 482 | |||
1649 | 483 | bool SnapcraftGenericPartFolderNode::removeFiles(const QStringList &, QStringList *) | ||
1650 | 484 | { | ||
1651 | 485 | return true; | ||
1652 | 486 | } | ||
1653 | 487 | |||
1654 | 488 | bool SnapcraftGenericPartFolderNode::deleteFiles(const QStringList &) | ||
1655 | 489 | { | ||
1656 | 490 | return true; | ||
1657 | 491 | } | ||
1658 | 492 | |||
1659 | 493 | |||
1660 | 494 | |||
1661 | 495 | } // namespace Internal | ||
1662 | 496 | } // namespace Ubuntu | ||
1663 | 0 | 497 | ||
1664 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.h' | |||
1665 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.h 1970-01-01 00:00:00 +0000 | |||
1666 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.h 2016-10-18 07:57:32 +0000 | |||
1667 | @@ -0,0 +1,136 @@ | |||
1668 | 1 | /* | ||
1669 | 2 | * Copyright 2016 Canonical Ltd. | ||
1670 | 3 | * | ||
1671 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1672 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1673 | 6 | * the Free Software Foundation; version 2.1. | ||
1674 | 7 | * | ||
1675 | 8 | * This program is distributed in the hope that it will be useful, | ||
1676 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1677 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1678 | 11 | * GNU Lesser General Public License for more details. | ||
1679 | 12 | * | ||
1680 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1681 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1682 | 15 | * | ||
1683 | 16 | * Author: Benjamin Zeller <benjamin.zeller@canonical.com> | ||
1684 | 17 | */ | ||
1685 | 18 | |||
1686 | 19 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTPROJECTNODE_H | ||
1687 | 20 | #define UBUNTU_INTERNAL_SNAPCRAFTPROJECTNODE_H | ||
1688 | 21 | |||
1689 | 22 | #include <projectexplorer/projectnodes.h> | ||
1690 | 23 | #include <projectexplorer/nodesvisitor.h> | ||
1691 | 24 | #include <yaml-cpp/node/node.h> | ||
1692 | 25 | |||
1693 | 26 | #include <QPointer> | ||
1694 | 27 | |||
1695 | 28 | class QFileSystemWatcher; | ||
1696 | 29 | |||
1697 | 30 | namespace Ubuntu { | ||
1698 | 31 | namespace Internal { | ||
1699 | 32 | |||
1700 | 33 | class FindFilesAndDirsVisitor : public ProjectExplorer::NodesVisitor { | ||
1701 | 34 | public: | ||
1702 | 35 | Utils::FileNameList filePaths() const; | ||
1703 | 36 | Utils::FileNameList dirPaths() const; | ||
1704 | 37 | |||
1705 | 38 | void visitProjectNode(ProjectExplorer::ProjectNode *projectNode) override; | ||
1706 | 39 | void visitFolderNode(ProjectExplorer::FolderNode *folderNode) override; | ||
1707 | 40 | |||
1708 | 41 | private: | ||
1709 | 42 | Utils::FileNameList m_filePaths; | ||
1710 | 43 | Utils::FileNameList m_dirPaths; | ||
1711 | 44 | }; | ||
1712 | 45 | |||
1713 | 46 | class FindFileNodesForFileVisitor : public ProjectExplorer::NodesVisitor { | ||
1714 | 47 | |||
1715 | 48 | public: | ||
1716 | 49 | FindFileNodesForFileVisitor (const Utils::FileName &f); | ||
1717 | 50 | QList<ProjectExplorer::FileNode *> nodes () const; | ||
1718 | 51 | |||
1719 | 52 | void visitProjectNode(ProjectExplorer::ProjectNode *projectNode) override; | ||
1720 | 53 | void visitFolderNode(ProjectExplorer::FolderNode *folderNode) override; | ||
1721 | 54 | |||
1722 | 55 | private: | ||
1723 | 56 | Utils::FileName m_file; | ||
1724 | 57 | QList<ProjectExplorer::FileNode *> m_nodes; | ||
1725 | 58 | }; | ||
1726 | 59 | |||
1727 | 60 | class FindNodesForFolderVisitor : public ProjectExplorer::NodesVisitor { | ||
1728 | 61 | |||
1729 | 62 | public: | ||
1730 | 63 | FindNodesForFolderVisitor (const Utils::FileName &f); | ||
1731 | 64 | QList<ProjectExplorer::FolderNode *> nodes () const; | ||
1732 | 65 | |||
1733 | 66 | void visitProjectNode(ProjectExplorer::ProjectNode *projectNode) override; | ||
1734 | 67 | void visitFolderNode(ProjectExplorer::FolderNode *folderNode) override; | ||
1735 | 68 | |||
1736 | 69 | private: | ||
1737 | 70 | Utils::FileName m_folder; | ||
1738 | 71 | QList<ProjectExplorer::FolderNode *> m_nodes; | ||
1739 | 72 | }; | ||
1740 | 73 | |||
1741 | 74 | class SnapcraftProject; | ||
1742 | 75 | class SnapcraftGenericPartNode; | ||
1743 | 76 | |||
1744 | 77 | class SnapcraftProjectNode : public ProjectExplorer::ProjectNode | ||
1745 | 78 | { | ||
1746 | 79 | public: | ||
1747 | 80 | SnapcraftProjectNode(SnapcraftProject *rootProject, const Utils::FileName &projectFilePath, QFileSystemWatcher *watcher); | ||
1748 | 81 | ~SnapcraftProjectNode(); | ||
1749 | 82 | |||
1750 | 83 | bool syncFromYAMLNode(YAML::Node rootNode); | ||
1751 | 84 | |||
1752 | 85 | private: | ||
1753 | 86 | SnapcraftProject *m_rootProject = nullptr; | ||
1754 | 87 | QPointer<QFileSystemWatcher> m_watcher; | ||
1755 | 88 | }; | ||
1756 | 89 | |||
1757 | 90 | class SnapcraftGenericPartFolderNode : public ProjectExplorer::FolderNode | ||
1758 | 91 | { | ||
1759 | 92 | public: | ||
1760 | 93 | |||
1761 | 94 | using ProjectExplorer::FolderNode::FolderNode; | ||
1762 | 95 | |||
1763 | 96 | // FolderNode interface | ||
1764 | 97 | virtual bool addFiles(const QStringList &filePaths, QStringList *notAdded) override; | ||
1765 | 98 | virtual bool removeFiles(const QStringList &filePaths, QStringList *notRemoved) override; | ||
1766 | 99 | virtual bool deleteFiles(const QStringList &filePaths) override; | ||
1767 | 100 | }; | ||
1768 | 101 | |||
1769 | 102 | class SnapcraftGenericPartNode : public ProjectExplorer::FolderNode | ||
1770 | 103 | { | ||
1771 | 104 | public: | ||
1772 | 105 | SnapcraftGenericPartNode(const QString &partName, const Utils::FileName &folderPath, QFileSystemWatcher *watcher); | ||
1773 | 106 | ~SnapcraftGenericPartNode(); | ||
1774 | 107 | |||
1775 | 108 | void maybeScheduleProjectScan(const QString &changedPath); | ||
1776 | 109 | void scheduleProjectScan(); | ||
1777 | 110 | |||
1778 | 111 | using ProjectExplorer::FolderNode::removeFileNodes; | ||
1779 | 112 | void removeFileNodes (const QList<Utils::FileName> &files); | ||
1780 | 113 | |||
1781 | 114 | using ProjectExplorer::FolderNode::removeFolderNodes; | ||
1782 | 115 | void removeFolderNodes (QList<Utils::FileName> &dirs); | ||
1783 | 116 | |||
1784 | 117 | // Node interface | ||
1785 | 118 | virtual QList<ProjectExplorer::ProjectAction> supportedActions(ProjectExplorer::Node *node) const override; | ||
1786 | 119 | virtual bool addFiles(const QStringList &filePaths, QStringList *notAdded) override; | ||
1787 | 120 | virtual bool removeFiles(const QStringList &filePaths, QStringList *notRemoved) override; | ||
1788 | 121 | virtual bool deleteFiles(const QStringList &filePaths) override; | ||
1789 | 122 | |||
1790 | 123 | protected: | ||
1791 | 124 | ProjectExplorer::FolderNode *createOrFindFolder (const QStringList &folder); | ||
1792 | 125 | void scanProjectDirectory (); | ||
1793 | 126 | |||
1794 | 127 | private: | ||
1795 | 128 | bool m_scanning = false; | ||
1796 | 129 | QMetaObject::Connection m_watcherConnection; | ||
1797 | 130 | QPointer<QFileSystemWatcher> m_watcher; | ||
1798 | 131 | }; | ||
1799 | 132 | |||
1800 | 133 | } // namespace Internal | ||
1801 | 134 | } // namespace Ubuntu | ||
1802 | 135 | |||
1803 | 136 | #endif // UBUNTU_INTERNAL_SNAPCRAFTPROJECTNODE_H | ||
1804 | 0 | 137 | ||
1805 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftrsyncstep.cpp' | |||
1806 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftrsyncstep.cpp 1970-01-01 00:00:00 +0000 | |||
1807 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftrsyncstep.cpp 2016-10-18 07:57:32 +0000 | |||
1808 | @@ -0,0 +1,51 @@ | |||
1809 | 1 | #include "snapcraftrsyncstep.h" | ||
1810 | 2 | #include "snapcraftproject.h" | ||
1811 | 3 | #include "snapcraftbuildconfiguration.h" | ||
1812 | 4 | |||
1813 | 5 | #include <ubuntu/ubuntuconstants.h> | ||
1814 | 6 | |||
1815 | 7 | #include <projectexplorer/target.h> | ||
1816 | 8 | |||
1817 | 9 | namespace Ubuntu { | ||
1818 | 10 | namespace Internal { | ||
1819 | 11 | |||
1820 | 12 | SnapcraftRsyncStep::SnapcraftRsyncStep(ProjectExplorer::BuildStepList *bsl) | ||
1821 | 13 | : ProjectExplorer::AbstractProcessStep(bsl, Constants::SNAPCRAFT_RSYNCBUILSSTEP_ID) | ||
1822 | 14 | { | ||
1823 | 15 | setDefaultDisplayName(tr("Prepare build")); | ||
1824 | 16 | } | ||
1825 | 17 | |||
1826 | 18 | SnapcraftRsyncStep::SnapcraftRsyncStep(ProjectExplorer::BuildStepList *bsl, SnapcraftRsyncStep *bs) | ||
1827 | 19 | : ProjectExplorer::AbstractProcessStep(bsl, bs) | ||
1828 | 20 | { | ||
1829 | 21 | |||
1830 | 22 | } | ||
1831 | 23 | |||
1832 | 24 | bool SnapcraftRsyncStep::init(QList<const ProjectExplorer::BuildStep *> &) | ||
1833 | 25 | { | ||
1834 | 26 | QString projectDir = target()->project()->projectDirectory().toString(); | ||
1835 | 27 | |||
1836 | 28 | ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration(); | ||
1837 | 29 | if(!bc) | ||
1838 | 30 | return false; | ||
1839 | 31 | |||
1840 | 32 | ProjectExplorer::ProcessParameters *param = processParameters(); | ||
1841 | 33 | param->setWorkingDirectory(bc->buildDirectory().toUserOutput()); | ||
1842 | 34 | param->setCommand(QStringLiteral("rsync")); | ||
1843 | 35 | param->setArguments(QString::fromLatin1("-a --delete \"%1/\" \"./\"") | ||
1844 | 36 | .arg(QDir::cleanPath(projectDir))); | ||
1845 | 37 | param->setMacroExpander(bc->macroExpander()); | ||
1846 | 38 | param->setEnvironment(bc->environment()); | ||
1847 | 39 | |||
1848 | 40 | return true; | ||
1849 | 41 | } | ||
1850 | 42 | |||
1851 | 43 | ProjectExplorer::BuildStepConfigWidget *SnapcraftRsyncStep::createConfigWidget() | ||
1852 | 44 | { | ||
1853 | 45 | return new ProjectExplorer::SimpleBuildStepConfigWidget(this); | ||
1854 | 46 | } | ||
1855 | 47 | |||
1856 | 48 | |||
1857 | 49 | |||
1858 | 50 | } // namespace Internal | ||
1859 | 51 | } // namespace Ubuntu | ||
1860 | 0 | 52 | ||
1861 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftrsyncstep.h' | |||
1862 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftrsyncstep.h 1970-01-01 00:00:00 +0000 | |||
1863 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftrsyncstep.h 2016-10-18 07:57:32 +0000 | |||
1864 | @@ -0,0 +1,31 @@ | |||
1865 | 1 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTRSYNCSTEP_H | ||
1866 | 2 | #define UBUNTU_INTERNAL_SNAPCRAFTRSYNCSTEP_H | ||
1867 | 3 | |||
1868 | 4 | #include <projectexplorer/abstractprocessstep.h> | ||
1869 | 5 | |||
1870 | 6 | namespace Ubuntu { | ||
1871 | 7 | namespace Internal { | ||
1872 | 8 | |||
1873 | 9 | class SnapcraftBuildStepFactory; | ||
1874 | 10 | class SnapcraftBuildConfigurationFactory; | ||
1875 | 11 | |||
1876 | 12 | class SnapcraftRsyncStep : public ProjectExplorer::AbstractProcessStep | ||
1877 | 13 | { | ||
1878 | 14 | Q_OBJECT | ||
1879 | 15 | public: | ||
1880 | 16 | friend class SnapcraftBuildStepFactory; | ||
1881 | 17 | friend class SnapcraftBuildConfigurationFactory; | ||
1882 | 18 | |||
1883 | 19 | // BuildStep interface | ||
1884 | 20 | virtual bool init(QList<const ProjectExplorer::BuildStep *> &earlierSteps) override; | ||
1885 | 21 | virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; | ||
1886 | 22 | |||
1887 | 23 | protected: | ||
1888 | 24 | SnapcraftRsyncStep(ProjectExplorer::BuildStepList *bsl); | ||
1889 | 25 | SnapcraftRsyncStep(ProjectExplorer::BuildStepList *bsl, SnapcraftRsyncStep *bs); | ||
1890 | 26 | }; | ||
1891 | 27 | |||
1892 | 28 | } // namespace Internal | ||
1893 | 29 | } // namespace Ubuntu | ||
1894 | 30 | |||
1895 | 31 | #endif // UBUNTU_INTERNAL_SNAPCRAFTRSYNCSTEP_H | ||
1896 | 0 | 32 | ||
1897 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftstep.cpp' | |||
1898 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftstep.cpp 1970-01-01 00:00:00 +0000 | |||
1899 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftstep.cpp 2016-10-18 07:57:32 +0000 | |||
1900 | @@ -0,0 +1,67 @@ | |||
1901 | 1 | #include "snapcraftstep.h" | ||
1902 | 2 | #include "snapcraftproject.h" | ||
1903 | 3 | #include "snapcraftbuildconfiguration.h" | ||
1904 | 4 | |||
1905 | 5 | #include <ubuntu/snap/settings/snapcraftkitinformation.h> | ||
1906 | 6 | |||
1907 | 7 | #include <ubuntu/ubuntuconstants.h> | ||
1908 | 8 | |||
1909 | 9 | #include <projectexplorer/target.h> | ||
1910 | 10 | #include <utils/environment.h> | ||
1911 | 11 | |||
1912 | 12 | namespace Ubuntu { | ||
1913 | 13 | namespace Internal { | ||
1914 | 14 | |||
1915 | 15 | SnapcraftStep::SnapcraftStep(ProjectExplorer::BuildStepList *bsl) | ||
1916 | 16 | : ProjectExplorer::AbstractProcessStep(bsl, Constants::SNAPCRAFT_BUILDSTEP_ID) | ||
1917 | 17 | { | ||
1918 | 18 | setDefaultDisplayName(tr("Snapcraft")); | ||
1919 | 19 | } | ||
1920 | 20 | |||
1921 | 21 | SnapcraftStep::SnapcraftStep(ProjectExplorer::BuildStepList *bsl, SnapcraftStep *bs) | ||
1922 | 22 | : ProjectExplorer::AbstractProcessStep(bsl, bs) | ||
1923 | 23 | { | ||
1924 | 24 | |||
1925 | 25 | } | ||
1926 | 26 | |||
1927 | 27 | bool SnapcraftStep::init(QList<const ProjectExplorer::BuildStep *> &) | ||
1928 | 28 | { | ||
1929 | 29 | //QString projectDir = target()->project()->projectDirectory().toString(); | ||
1930 | 30 | ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration(); | ||
1931 | 31 | if(!bc) | ||
1932 | 32 | return false; | ||
1933 | 33 | |||
1934 | 34 | Utils::FileName snapcraftBin = Utils::FileName::fromString(Constants::UBUNTU_SCRIPTPATH); | ||
1935 | 35 | snapcraftBin = snapcraftBin.appendPath(QString::fromLatin1("run_snapcraft.py")); | ||
1936 | 36 | |||
1937 | 37 | ProjectExplorer::ProcessParameters *param = processParameters(); | ||
1938 | 38 | param->setWorkingDirectory(bc->buildDirectory().toUserOutput()); | ||
1939 | 39 | param->setCommand(snapcraftBin.toUserOutput()); | ||
1940 | 40 | param->setArguments(QString::fromLatin1("-s '%1'").arg(snapcraftBin.toFileInfo().absoluteFilePath())); | ||
1941 | 41 | param->setMacroExpander(bc->macroExpander()); | ||
1942 | 42 | param->setEnvironment(bc->environment()); | ||
1943 | 43 | |||
1944 | 44 | return true; | ||
1945 | 45 | } | ||
1946 | 46 | |||
1947 | 47 | ProjectExplorer::BuildStepConfigWidget *SnapcraftStep::createConfigWidget() | ||
1948 | 48 | { | ||
1949 | 49 | return new ProjectExplorer::SimpleBuildStepConfigWidget(this); | ||
1950 | 50 | } | ||
1951 | 51 | |||
1952 | 52 | Utils::FileName SnapcraftStep::snapcraftCommand() const | ||
1953 | 53 | { | ||
1954 | 54 | Utils::Environment env = Utils::Environment::systemEnvironment(); | ||
1955 | 55 | Utils::FileName fallback = env.searchInPath(QStringLiteral("snapcraft")); | ||
1956 | 56 | if (!target()) | ||
1957 | 57 | return fallback; | ||
1958 | 58 | |||
1959 | 59 | Utils::FileName bin = SnapcraftKitInformation::snapcraftPath(target()->kit()); | ||
1960 | 60 | if (!bin.exists()) | ||
1961 | 61 | return fallback; | ||
1962 | 62 | |||
1963 | 63 | return bin; | ||
1964 | 64 | } | ||
1965 | 65 | |||
1966 | 66 | } // namespace Internal | ||
1967 | 67 | } // namespace Ubuntu | ||
1968 | 0 | 68 | ||
1969 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftstep.h' | |||
1970 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftstep.h 1970-01-01 00:00:00 +0000 | |||
1971 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftstep.h 2016-10-18 07:57:32 +0000 | |||
1972 | @@ -0,0 +1,33 @@ | |||
1973 | 1 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTSTEP_H | ||
1974 | 2 | #define UBUNTU_INTERNAL_SNAPCRAFTSTEP_H | ||
1975 | 3 | |||
1976 | 4 | #include <projectexplorer/abstractprocessstep.h> | ||
1977 | 5 | |||
1978 | 6 | namespace Ubuntu { | ||
1979 | 7 | namespace Internal { | ||
1980 | 8 | |||
1981 | 9 | class SnapcraftBuildStepFactory; | ||
1982 | 10 | class SnapcraftBuildConfigurationFactory; | ||
1983 | 11 | |||
1984 | 12 | class SnapcraftStep : public ProjectExplorer::AbstractProcessStep | ||
1985 | 13 | { | ||
1986 | 14 | Q_OBJECT | ||
1987 | 15 | public: | ||
1988 | 16 | friend class SnapcraftBuildStepFactory; | ||
1989 | 17 | friend class SnapcraftBuildConfigurationFactory; | ||
1990 | 18 | |||
1991 | 19 | // BuildStep interface | ||
1992 | 20 | virtual bool init(QList<const ProjectExplorer::BuildStep *> &earlierSteps) override; | ||
1993 | 21 | virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; | ||
1994 | 22 | |||
1995 | 23 | Utils::FileName snapcraftCommand () const; | ||
1996 | 24 | |||
1997 | 25 | protected: | ||
1998 | 26 | SnapcraftStep(ProjectExplorer::BuildStepList *bsl); | ||
1999 | 27 | SnapcraftStep(ProjectExplorer::BuildStepList *bsl, SnapcraftStep *bs); | ||
2000 | 28 | }; | ||
2001 | 29 | |||
2002 | 30 | } // namespace Internal | ||
2003 | 31 | } // namespace Ubuntu | ||
2004 | 32 | |||
2005 | 33 | #endif // UBUNTU_INTERNAL_SNAPCRAFTSTEP_H | ||
2006 | 0 | 34 | ||
2007 | === added directory 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings' | |||
2008 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings/snapcraftkitinformation.cpp' | |||
2009 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings/snapcraftkitinformation.cpp 1970-01-01 00:00:00 +0000 | |||
2010 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings/snapcraftkitinformation.cpp 2016-10-18 07:57:32 +0000 | |||
2011 | @@ -0,0 +1,114 @@ | |||
2012 | 1 | #include "snapcraftkitinformation.h" | ||
2013 | 2 | |||
2014 | 3 | #include <projectexplorer/kit.h> | ||
2015 | 4 | |||
2016 | 5 | #include <utils/environment.h> | ||
2017 | 6 | #include <utils/qtcassert.h> | ||
2018 | 7 | #include <utils/pathchooser.h> | ||
2019 | 8 | |||
2020 | 9 | #include <QFileInfo> | ||
2021 | 10 | |||
2022 | 11 | namespace Ubuntu { | ||
2023 | 12 | namespace Internal { | ||
2024 | 13 | |||
2025 | 14 | static const char TOOL_ID[] = "SnapcraftProjectManager.SnapcraftKitInformation"; | ||
2026 | 15 | |||
2027 | 16 | SnapcraftKitInformation::SnapcraftKitInformation() | ||
2028 | 17 | { | ||
2029 | 18 | setObjectName(QStringLiteral("SnapcraftKitInformation")); | ||
2030 | 19 | setId(TOOL_ID); | ||
2031 | 20 | setPriority(29000); | ||
2032 | 21 | } | ||
2033 | 22 | |||
2034 | 23 | Utils::FileName SnapcraftKitInformation::snapcraftPath(const ProjectExplorer::Kit *k) | ||
2035 | 24 | { | ||
2036 | 25 | return k->value(TOOL_ID, QVariant::fromValue<Utils::FileName>(Utils::FileName())).value<Utils::FileName>(); | ||
2037 | 26 | } | ||
2038 | 27 | |||
2039 | 28 | void SnapcraftKitInformation::setSnapcraftPath(ProjectExplorer::Kit *k, const Utils::FileName &snapcraft) | ||
2040 | 29 | { | ||
2041 | 30 | if (snapcraft.toFileInfo().isExecutable()) { | ||
2042 | 31 | k->setValue(TOOL_ID, QVariant::fromValue<Utils::FileName>(snapcraft)); | ||
2043 | 32 | } | ||
2044 | 33 | } | ||
2045 | 34 | |||
2046 | 35 | QVariant SnapcraftKitInformation::defaultValue(const ProjectExplorer::Kit *) const | ||
2047 | 36 | { | ||
2048 | 37 | Utils::Environment env = Utils::Environment::systemEnvironment(); | ||
2049 | 38 | return QVariant::fromValue<Utils::FileName>(env.searchInPath(QStringLiteral("snapcraft"))); | ||
2050 | 39 | } | ||
2051 | 40 | |||
2052 | 41 | QList<ProjectExplorer::Task> SnapcraftKitInformation::validate(const ProjectExplorer::Kit *) const | ||
2053 | 42 | { | ||
2054 | 43 | return QList<ProjectExplorer::Task>(); | ||
2055 | 44 | } | ||
2056 | 45 | |||
2057 | 46 | ProjectExplorer::KitInformation::ItemList SnapcraftKitInformation::toUserOutput(const ProjectExplorer::Kit *k) const | ||
2058 | 47 | { | ||
2059 | 48 | Utils::FileName snap = snapcraftPath(k); | ||
2060 | 49 | return ItemList { | ||
2061 | 50 | qMakePair(tr("Snapcraft"), snap.exists() ? snap.toUserOutput() : tr("Unconfigured")) | ||
2062 | 51 | }; | ||
2063 | 52 | } | ||
2064 | 53 | |||
2065 | 54 | ProjectExplorer::KitConfigWidget *SnapcraftKitInformation::createConfigWidget(ProjectExplorer::Kit *kit) const | ||
2066 | 55 | { | ||
2067 | 56 | return new SnapcraftKitInformationWidget(kit, this); | ||
2068 | 57 | } | ||
2069 | 58 | |||
2070 | 59 | SnapcraftKitInformationWidget::SnapcraftKitInformationWidget(ProjectExplorer::Kit *kit, const ProjectExplorer::KitInformation *ki) | ||
2071 | 60 | : ProjectExplorer::KitConfigWidget(kit, ki) | ||
2072 | 61 | , m_chooser(new Utils::PathChooser) | ||
2073 | 62 | , m_ignoreChange(false) | ||
2074 | 63 | { | ||
2075 | 64 | m_chooser->setExpectedKind(Utils::PathChooser::ExistingCommand); | ||
2076 | 65 | m_chooser->setFileName(SnapcraftKitInformation::snapcraftPath(kit)); | ||
2077 | 66 | connect(m_chooser, &Utils::PathChooser::pathChanged, | ||
2078 | 67 | this, &SnapcraftKitInformationWidget::pathWasChanged); | ||
2079 | 68 | } | ||
2080 | 69 | |||
2081 | 70 | SnapcraftKitInformationWidget::~SnapcraftKitInformationWidget() | ||
2082 | 71 | { | ||
2083 | 72 | delete m_chooser; | ||
2084 | 73 | } | ||
2085 | 74 | |||
2086 | 75 | QString SnapcraftKitInformationWidget::displayName() const | ||
2087 | 76 | { | ||
2088 | 77 | return tr("Snapcraft"); | ||
2089 | 78 | } | ||
2090 | 79 | |||
2091 | 80 | void SnapcraftKitInformationWidget::makeReadOnly() | ||
2092 | 81 | { | ||
2093 | 82 | m_chooser->setReadOnly(true); | ||
2094 | 83 | } | ||
2095 | 84 | |||
2096 | 85 | void SnapcraftKitInformationWidget::refresh() | ||
2097 | 86 | { | ||
2098 | 87 | if (!m_ignoreChange) | ||
2099 | 88 | m_chooser->setPath(SnapcraftKitInformation::snapcraftPath(kit()).toUserOutput()); | ||
2100 | 89 | } | ||
2101 | 90 | |||
2102 | 91 | QWidget *SnapcraftKitInformationWidget::mainWidget() const | ||
2103 | 92 | { | ||
2104 | 93 | return m_chooser->lineEdit(); | ||
2105 | 94 | } | ||
2106 | 95 | |||
2107 | 96 | QString SnapcraftKitInformationWidget::toolTip() const | ||
2108 | 97 | { | ||
2109 | 98 | return tr("The snapcraft binary to use for this kit."); | ||
2110 | 99 | } | ||
2111 | 100 | |||
2112 | 101 | QWidget *SnapcraftKitInformationWidget::buttonWidget() const | ||
2113 | 102 | { | ||
2114 | 103 | return m_chooser->buttonAtIndex(0); | ||
2115 | 104 | } | ||
2116 | 105 | |||
2117 | 106 | void SnapcraftKitInformationWidget::pathWasChanged() | ||
2118 | 107 | { | ||
2119 | 108 | m_ignoreChange = true; | ||
2120 | 109 | SnapcraftKitInformation::setSnapcraftPath(kit(), m_chooser->fileName()); | ||
2121 | 110 | m_ignoreChange = false; | ||
2122 | 111 | } | ||
2123 | 112 | |||
2124 | 113 | } // namespace Internal | ||
2125 | 114 | } // namespace Ubuntu | ||
2126 | 0 | 115 | ||
2127 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings/snapcraftkitinformation.h' | |||
2128 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings/snapcraftkitinformation.h 1970-01-01 00:00:00 +0000 | |||
2129 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/settings/snapcraftkitinformation.h 2016-10-18 07:57:32 +0000 | |||
2130 | @@ -0,0 +1,59 @@ | |||
2131 | 1 | #ifndef UBUNTU_INTERNAL_SNAPCRAFTKITINFORMATION_H | ||
2132 | 2 | #define UBUNTU_INTERNAL_SNAPCRAFTKITINFORMATION_H | ||
2133 | 3 | |||
2134 | 4 | #include <projectexplorer/kitconfigwidget.h> | ||
2135 | 5 | #include <projectexplorer/kitinformation.h> | ||
2136 | 6 | |||
2137 | 7 | namespace Utils { | ||
2138 | 8 | class PathChooser; | ||
2139 | 9 | } | ||
2140 | 10 | |||
2141 | 11 | namespace Ubuntu { | ||
2142 | 12 | namespace Internal { | ||
2143 | 13 | |||
2144 | 14 | class SnapcraftKitInformation : public ProjectExplorer::KitInformation | ||
2145 | 15 | { | ||
2146 | 16 | Q_OBJECT | ||
2147 | 17 | public: | ||
2148 | 18 | SnapcraftKitInformation(); | ||
2149 | 19 | |||
2150 | 20 | static Utils::FileName snapcraftPath (const ProjectExplorer::Kit *k); | ||
2151 | 21 | static void setSnapcraftPath (ProjectExplorer::Kit *k, const Utils::FileName &snapcraft); | ||
2152 | 22 | |||
2153 | 23 | // KitInformation interface | ||
2154 | 24 | virtual QVariant defaultValue(const ProjectExplorer::Kit *) const override; | ||
2155 | 25 | virtual QList<ProjectExplorer::Task> validate(const ProjectExplorer::Kit *) const override; | ||
2156 | 26 | virtual ItemList toUserOutput(const ProjectExplorer::Kit *) const override; | ||
2157 | 27 | virtual ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *) const override; | ||
2158 | 28 | |||
2159 | 29 | private: | ||
2160 | 30 | Utils::FileName m_snapcraftPath; | ||
2161 | 31 | }; | ||
2162 | 32 | |||
2163 | 33 | class SnapcraftKitInformationWidget : public ProjectExplorer::KitConfigWidget | ||
2164 | 34 | { | ||
2165 | 35 | public: | ||
2166 | 36 | SnapcraftKitInformationWidget(ProjectExplorer::Kit *kit, const ProjectExplorer::KitInformation *ki); | ||
2167 | 37 | virtual ~SnapcraftKitInformationWidget(); | ||
2168 | 38 | |||
2169 | 39 | // KitConfigWidget interface | ||
2170 | 40 | virtual QString displayName() const override; | ||
2171 | 41 | virtual void makeReadOnly() override; | ||
2172 | 42 | virtual void refresh() override; | ||
2173 | 43 | virtual QWidget *mainWidget() const override; | ||
2174 | 44 | virtual QString toolTip() const override; | ||
2175 | 45 | virtual QWidget *buttonWidget() const override; | ||
2176 | 46 | |||
2177 | 47 | private: | ||
2178 | 48 | void pathWasChanged(); | ||
2179 | 49 | private: | ||
2180 | 50 | Utils::PathChooser *m_chooser; | ||
2181 | 51 | bool m_ignoreChange; | ||
2182 | 52 | |||
2183 | 53 | |||
2184 | 54 | }; | ||
2185 | 55 | |||
2186 | 56 | } // namespace Internal | ||
2187 | 57 | } // namespace Ubuntu | ||
2188 | 58 | |||
2189 | 59 | #endif // UBUNTU_INTERNAL_SNAPCRAFTKITINFORMATION_H | ||
2190 | 0 | 60 | ||
2191 | === added file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snap.pri' | |||
2192 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snap.pri 1970-01-01 00:00:00 +0000 | |||
2193 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/snap.pri 2016-10-18 07:57:32 +0000 | |||
2194 | @@ -0,0 +1,27 @@ | |||
2195 | 1 | |||
2196 | 2 | LIBS+=-lyaml-cpp | ||
2197 | 3 | |||
2198 | 4 | SOURCES += \ | ||
2199 | 5 | $$PWD/project/snapcraftproject.cpp \ | ||
2200 | 6 | $$PWD/project/snapcraftprojectfile.cpp \ | ||
2201 | 7 | $$PWD/project/snapcraftprojectnode.cpp \ | ||
2202 | 8 | $$PWD/project/snapcraftprojectmanager.cpp \ | ||
2203 | 9 | $$PWD/project/snapcraftbuildconfigurationfactory.cpp \ | ||
2204 | 10 | $$PWD/project/snapcraftbuildconfiguration.cpp \ | ||
2205 | 11 | $$PWD/project/snapcraftrsyncstep.cpp \ | ||
2206 | 12 | $$PWD/project/snapcraftstep.cpp \ | ||
2207 | 13 | $$PWD/project/snapcraftbuildstepfactory.cpp \ | ||
2208 | 14 | $$PWD/settings/snapcraftkitinformation.cpp | ||
2209 | 15 | |||
2210 | 16 | HEADERS += \ | ||
2211 | 17 | $$PWD/project/snapcraftproject.h \ | ||
2212 | 18 | $$PWD/project/snapcraftprojectfile.h \ | ||
2213 | 19 | $$PWD/project/snapcraftprojectnode.h \ | ||
2214 | 20 | $$PWD/project/snapcraftprojectmanager.h \ | ||
2215 | 21 | $$PWD/project/snapcraftbuildconfigurationfactory.h \ | ||
2216 | 22 | $$PWD/project/snapcraftbuildconfiguration.h \ | ||
2217 | 23 | $$PWD/project/snapcraftrsyncstep.h \ | ||
2218 | 24 | $$PWD/project/snapcraftstep.h \ | ||
2219 | 25 | $$PWD/project/snapcraftbuildstepfactory.h \ | ||
2220 | 26 | $$PWD/settings/snapcraftkitinformation.h | ||
2221 | 27 | |||
2222 | 0 | 28 | ||
2223 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuclicktool.cpp' | |||
2224 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuclicktool.cpp 2016-08-26 14:14:29 +0000 | |||
2225 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuclicktool.cpp 2016-10-18 07:57:32 +0000 | |||
2226 | @@ -471,6 +471,11 @@ | |||
2227 | 471 | return UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("make"),target); | 471 | return UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("make"),target); |
2228 | 472 | } | 472 | } |
2229 | 473 | 473 | ||
2230 | 474 | Utils::FileName UbuntuClickTool::findOrCreateSnapcraftWrapper(const UbuntuClickTool::Target &target) | ||
2231 | 475 | { | ||
2232 | 476 | return Utils::FileName::fromString(UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("snapcraft"),target)); | ||
2233 | 477 | } | ||
2234 | 478 | |||
2235 | 474 | QString UbuntuClickTool::mapIncludePathsForCMake(const ProjectExplorer::Kit *k, const QString &in) | 479 | QString UbuntuClickTool::mapIncludePathsForCMake(const ProjectExplorer::Kit *k, const QString &in) |
2236 | 475 | { | 480 | { |
2237 | 476 | if (in.isEmpty()) | 481 | if (in.isEmpty()) |
2238 | 477 | 482 | ||
2239 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuclicktool.h' | |||
2240 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuclicktool.h 2016-08-26 14:14:29 +0000 | |||
2241 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuclicktool.h 2016-10-18 07:57:32 +0000 | |||
2242 | @@ -86,6 +86,7 @@ | |||
2243 | 86 | static QString findOrCreateToolWrapper(const QString &tool, const UbuntuClickTool::Target &target); | 86 | static QString findOrCreateToolWrapper(const QString &tool, const UbuntuClickTool::Target &target); |
2244 | 87 | static QString findOrCreateQMakeWrapper(const UbuntuClickTool::Target &target); | 87 | static QString findOrCreateQMakeWrapper(const UbuntuClickTool::Target &target); |
2245 | 88 | static QString findOrCreateMakeWrapper(const UbuntuClickTool::Target &target); | 88 | static QString findOrCreateMakeWrapper(const UbuntuClickTool::Target &target); |
2246 | 89 | static Utils::FileName findOrCreateSnapcraftWrapper(const UbuntuClickTool::Target &target); | ||
2247 | 89 | static QString mapIncludePathsForCMake(const ProjectExplorer::Kit *k, const QString &in); | 90 | static QString mapIncludePathsForCMake(const ProjectExplorer::Kit *k, const QString &in); |
2248 | 90 | static QString hostArchitecture (); | 91 | static QString hostArchitecture (); |
2249 | 91 | static bool compatibleWithHostArchitecture (const QString &targetArch); | 92 | static bool compatibleWithHostArchitecture (const QString &targetArch); |
2250 | 92 | 93 | ||
2251 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuconstants.h' | |||
2252 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuconstants.h 2016-09-22 16:11:03 +0000 | |||
2253 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuconstants.h 2016-10-18 07:57:32 +0000 | |||
2254 | @@ -393,6 +393,16 @@ | |||
2255 | 393 | const char CHROOT_UPDATE_LIST_SCRIPT[] = "%1/ubuntu/scripts/qtc_chroot_get_upgrades.py %2 %3"; | 393 | const char CHROOT_UPDATE_LIST_SCRIPT[] = "%1/ubuntu/scripts/qtc_chroot_get_upgrades.py %2 %3"; |
2256 | 394 | 394 | ||
2257 | 395 | 395 | ||
2258 | 396 | //Snapcraft | ||
2259 | 397 | const char SNAPCRAFT_PROJECT_MIMETYPE[] = "application/x-snapcraft"; | ||
2260 | 398 | const char SNAPCRAFT_PROJECT_ID[ ] = "SnapcraftProjectManager.SnapcraftProject"; | ||
2261 | 399 | const char SNAPCRAFT_PROJECT_PROJECTCONTEXT[] = "SnapcraftProject.ProjectContext"; | ||
2262 | 400 | const char SNAPCRAFT_BUILDCONFIGURATION_ID[] = "SnapcraftProjectManager.SnapcraftBuildconfiguration.Id"; | ||
2263 | 401 | const char SNAPCRAFT_RSYNCBUILSSTEP_ID[] = "SnapcraftProjectManager.SnapcraftRsyncStep.Id"; | ||
2264 | 402 | const char SNAPCRAFT_BUILDSTEP_ID[] = "SnapcraftProjectManager.SnapcraftStep.Id"; | ||
2265 | 403 | |||
2266 | 404 | |||
2267 | 405 | |||
2268 | 396 | } // namespace Ubuntu | 406 | } // namespace Ubuntu |
2269 | 397 | } // namespace Constants | 407 | } // namespace Constants |
2270 | 398 | 408 | ||
2271 | 399 | 409 | ||
2272 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntukitmanager.cpp' | |||
2273 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntukitmanager.cpp 2016-08-26 14:14:29 +0000 | |||
2274 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntukitmanager.cpp 2016-10-18 07:57:32 +0000 | |||
2275 | @@ -5,7 +5,8 @@ | |||
2276 | 5 | #include "ubuntuclickdialog.h" | 5 | #include "ubuntuclickdialog.h" |
2277 | 6 | #include "ubuntuqtversion.h" | 6 | #include "ubuntuqtversion.h" |
2278 | 7 | #include "settings.h" | 7 | #include "settings.h" |
2280 | 8 | #include "device/container/containerdevice.h" | 8 | #include <ubuntu/device/container/containerdevice.h> |
2281 | 9 | #include <ubuntu/snap/settings/snapcraftkitinformation.h> | ||
2282 | 9 | 10 | ||
2283 | 10 | #include <coreplugin/icore.h> | 11 | #include <coreplugin/icore.h> |
2284 | 11 | #include <projectexplorer/kitmanager.h> | 12 | #include <projectexplorer/kitmanager.h> |
2285 | @@ -509,6 +510,8 @@ | |||
2286 | 509 | ProjectExplorer::SysRootKitInformation::setSysRoot(k,Utils::FileName::fromString(UbuntuClickTool::targetBasePath(tc->clickTarget()))); | 510 | ProjectExplorer::SysRootKitInformation::setSysRoot(k,Utils::FileName::fromString(UbuntuClickTool::targetBasePath(tc->clickTarget()))); |
2287 | 510 | } | 511 | } |
2288 | 511 | 512 | ||
2289 | 513 | SnapcraftKitInformation::setSnapcraftPath(k, UbuntuClickTool::findOrCreateSnapcraftWrapper(tc->clickTarget())); | ||
2290 | 514 | |||
2291 | 512 | //make sure we point to a ubuntu device | 515 | //make sure we point to a ubuntu device |
2292 | 513 | Core::Id devId = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k); | 516 | Core::Id devId = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k); |
2293 | 514 | bool devValid = devId.isValid(); //invalid type | 517 | bool devValid = devId.isValid(); //invalid type |
2294 | 515 | 518 | ||
2295 | === modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp' | |||
2296 | --- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp 2016-09-22 16:11:03 +0000 | |||
2297 | +++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp 2016-10-18 07:57:32 +0000 | |||
2298 | @@ -53,6 +53,11 @@ | |||
2299 | 53 | #include <ubuntu/wizards/ubuntufirstrunwizard.h> | 53 | #include <ubuntu/wizards/ubuntufirstrunwizard.h> |
2300 | 54 | #include <ubuntu/wizards/ubuntuprojectmigrationwizard.h> | 54 | #include <ubuntu/wizards/ubuntuprojectmigrationwizard.h> |
2301 | 55 | 55 | ||
2302 | 56 | #include <ubuntu/snap/project/snapcraftprojectmanager.h> | ||
2303 | 57 | #include <ubuntu/snap/project/snapcraftbuildconfigurationfactory.h> | ||
2304 | 58 | #include <ubuntu/snap/project/snapcraftbuildstepfactory.h> | ||
2305 | 59 | #include <ubuntu/snap/settings/snapcraftkitinformation.h> | ||
2306 | 60 | |||
2307 | 56 | #include "ubuntujsextension.h" | 61 | #include "ubuntujsextension.h" |
2308 | 57 | 62 | ||
2309 | 58 | #include <coreplugin/modemanager.h> | 63 | #include <coreplugin/modemanager.h> |
2310 | @@ -175,6 +180,13 @@ | |||
2311 | 175 | addAutoReleasedObject(new UbuntuRemoteRunControlFactory); | 180 | addAutoReleasedObject(new UbuntuRemoteRunControlFactory); |
2312 | 176 | addAutoReleasedObject(new UbuntuLocalRunControlFactory); | 181 | addAutoReleasedObject(new UbuntuLocalRunControlFactory); |
2313 | 177 | 182 | ||
2314 | 183 | |||
2315 | 184 | addAutoReleasedObject(new SnapcraftProjectManager); | ||
2316 | 185 | addAutoReleasedObject(new SnapcraftBuildConfigurationFactory); | ||
2317 | 186 | addAutoReleasedObject(new SnapcraftBuildStepFactory); | ||
2318 | 187 | |||
2319 | 188 | ProjectExplorer::KitManager::registerKitInformation(new SnapcraftKitInformation); | ||
2320 | 189 | |||
2321 | 178 | // Build support | 190 | // Build support |
2322 | 179 | addAutoReleasedObject(new ClickToolChainFactory); | 191 | addAutoReleasedObject(new ClickToolChainFactory); |
2323 | 180 | addAutoReleasedObject(new UbuntuHtmlBuildConfigurationFactory); | 192 | addAutoReleasedObject(new UbuntuHtmlBuildConfigurationFactory); |
2324 | @@ -379,6 +391,7 @@ | |||
2325 | 379 | 391 | ||
2326 | 380 | while (!ok) { | 392 | while (!ok) { |
2327 | 381 | QProcess proc; | 393 | QProcess proc; |
2328 | 394 | qDebug()<<"Running "<<Constants::UBUNTU_TARGET_TOOL; | ||
2329 | 382 | proc.setProgram(Constants::UBUNTU_TARGET_TOOL); | 395 | proc.setProgram(Constants::UBUNTU_TARGET_TOOL); |
2330 | 383 | 396 | ||
2331 | 384 | QStringList args{QStringLiteral("initialized")}; | 397 | QStringList args{QStringLiteral("initialized")}; |
2332 | @@ -407,8 +420,7 @@ | |||
2333 | 407 | if (Settings::askForContainerSetup()) { | 420 | if (Settings::askForContainerSetup()) { |
2334 | 408 | QString text = tr("The container backend is not completely initialized.\n\n" | 421 | QString text = tr("The container backend is not completely initialized.\n\n" |
2335 | 409 | "Create default configuration?\n" | 422 | "Create default configuration?\n" |
2338 | 410 | "Not setting up the container configuration will\nmake it impossible to run applications locally.\n\n" | 423 | "Not setting up the container configuration will\nmake it impossible to run applications locally." |
2337 | 411 | "Note: Will override existing LXD configurations." | ||
2339 | 412 | ); | 424 | ); |
2340 | 413 | 425 | ||
2341 | 414 | QMessageBox box(QMessageBox::Question, qApp->applicationName(),text, QMessageBox::Yes | QMessageBox::No | QMessageBox::Abort, Core::ICore::mainWindow()); | 426 | QMessageBox box(QMessageBox::Question, qApp->applicationName(),text, QMessageBox::Yes | QMessageBox::No | QMessageBox::Abort, Core::ICore::mainWindow()); |
2342 | 415 | 427 | ||
2343 | === added directory 'dist/yaml-cpp' | |||
2344 | === added file 'dist/yaml-cpp/.clang-format' | |||
2345 | --- dist/yaml-cpp/.clang-format 1970-01-01 00:00:00 +0000 | |||
2346 | +++ dist/yaml-cpp/.clang-format 2016-10-18 07:57:32 +0000 | |||
2347 | @@ -0,0 +1,47 @@ | |||
2348 | 1 | --- | ||
2349 | 2 | # BasedOnStyle: Google | ||
2350 | 3 | AccessModifierOffset: -1 | ||
2351 | 4 | ConstructorInitializerIndentWidth: 4 | ||
2352 | 5 | AlignEscapedNewlinesLeft: true | ||
2353 | 6 | AlignTrailingComments: true | ||
2354 | 7 | AllowAllParametersOfDeclarationOnNextLine: true | ||
2355 | 8 | AllowShortIfStatementsOnASingleLine: false | ||
2356 | 9 | AllowShortLoopsOnASingleLine: false | ||
2357 | 10 | AlwaysBreakTemplateDeclarations: true | ||
2358 | 11 | AlwaysBreakBeforeMultilineStrings: true | ||
2359 | 12 | BreakBeforeBinaryOperators: false | ||
2360 | 13 | BreakBeforeTernaryOperators: true | ||
2361 | 14 | BreakConstructorInitializersBeforeComma: false | ||
2362 | 15 | BinPackParameters: true | ||
2363 | 16 | ColumnLimit: 80 | ||
2364 | 17 | ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
2365 | 18 | DerivePointerBinding: true | ||
2366 | 19 | ExperimentalAutoDetectBinPacking: false | ||
2367 | 20 | IndentCaseLabels: true | ||
2368 | 21 | MaxEmptyLinesToKeep: 1 | ||
2369 | 22 | NamespaceIndentation: None | ||
2370 | 23 | ObjCSpaceBeforeProtocolList: false | ||
2371 | 24 | PenaltyBreakBeforeFirstCallParameter: 1 | ||
2372 | 25 | PenaltyBreakComment: 60 | ||
2373 | 26 | PenaltyBreakString: 1000 | ||
2374 | 27 | PenaltyBreakFirstLessLess: 120 | ||
2375 | 28 | PenaltyExcessCharacter: 1000000 | ||
2376 | 29 | PenaltyReturnTypeOnItsOwnLine: 200 | ||
2377 | 30 | PointerBindsToType: true | ||
2378 | 31 | SpacesBeforeTrailingComments: 2 | ||
2379 | 32 | Cpp11BracedListStyle: true | ||
2380 | 33 | Standard: Auto | ||
2381 | 34 | IndentWidth: 2 | ||
2382 | 35 | TabWidth: 8 | ||
2383 | 36 | UseTab: Never | ||
2384 | 37 | BreakBeforeBraces: Attach | ||
2385 | 38 | IndentFunctionDeclarationAfterType: true | ||
2386 | 39 | SpacesInParentheses: false | ||
2387 | 40 | SpacesInAngles: false | ||
2388 | 41 | SpaceInEmptyParentheses: false | ||
2389 | 42 | SpacesInCStyleCastParentheses: false | ||
2390 | 43 | SpaceAfterControlStatementKeyword: true | ||
2391 | 44 | SpaceBeforeAssignmentOperators: true | ||
2392 | 45 | ContinuationIndentWidth: 4 | ||
2393 | 46 | ... | ||
2394 | 47 | |||
2395 | 0 | 48 | ||
2396 | === added file 'dist/yaml-cpp/.hgeol' | |||
2397 | --- dist/yaml-cpp/.hgeol 1970-01-01 00:00:00 +0000 | |||
2398 | +++ dist/yaml-cpp/.hgeol 2016-10-18 07:57:32 +0000 | |||
2399 | @@ -0,0 +1,4 @@ | |||
2400 | 1 | **.h = native | ||
2401 | 2 | **.c = native | ||
2402 | 3 | **.cpp = native | ||
2403 | 4 | **.txt = native | ||
2404 | 0 | 5 | ||
2405 | === added file 'dist/yaml-cpp/.hgignore' | |||
2406 | --- dist/yaml-cpp/.hgignore 1970-01-01 00:00:00 +0000 | |||
2407 | +++ dist/yaml-cpp/.hgignore 2016-10-18 07:57:32 +0000 | |||
2408 | @@ -0,0 +1,1 @@ | |||
2409 | 1 | syntax: glob | ||
2410 | 0 | 2 | ||
2411 | === added directory 'dist/yaml-cpp/.pc' | |||
2412 | === added file 'dist/yaml-cpp/.pc/.quilt_patches' | |||
2413 | --- dist/yaml-cpp/.pc/.quilt_patches 1970-01-01 00:00:00 +0000 | |||
2414 | +++ dist/yaml-cpp/.pc/.quilt_patches 2016-10-18 07:57:32 +0000 | |||
2415 | @@ -0,0 +1,1 @@ | |||
2416 | 1 | debian/patches | ||
2417 | 0 | 2 | ||
2418 | === added file 'dist/yaml-cpp/.pc/.quilt_series' | |||
2419 | --- dist/yaml-cpp/.pc/.quilt_series 1970-01-01 00:00:00 +0000 | |||
2420 | +++ dist/yaml-cpp/.pc/.quilt_series 2016-10-18 07:57:32 +0000 | |||
2421 | @@ -0,0 +1,1 @@ | |||
2422 | 1 | series | ||
2423 | 0 | 2 | ||
2424 | === added file 'dist/yaml-cpp/.pc/.version' | |||
2425 | --- dist/yaml-cpp/.pc/.version 1970-01-01 00:00:00 +0000 | |||
2426 | +++ dist/yaml-cpp/.pc/.version 2016-10-18 07:57:32 +0000 | |||
2427 | @@ -0,0 +1,1 @@ | |||
2428 | 1 | 2 | ||
2429 | 0 | 2 | ||
2430 | === added file 'dist/yaml-cpp/.pc/applied-patches' | |||
2431 | --- dist/yaml-cpp/.pc/applied-patches 1970-01-01 00:00:00 +0000 | |||
2432 | +++ dist/yaml-cpp/.pc/applied-patches 2016-10-18 07:57:32 +0000 | |||
2433 | @@ -0,0 +1,2 @@ | |||
2434 | 1 | pkgconfig.patch | ||
2435 | 2 | install-cmake-dev-files.patch | ||
2436 | 0 | 3 | ||
2437 | === added directory 'dist/yaml-cpp/.pc/install-cmake-dev-files.patch' | |||
2438 | === added file 'dist/yaml-cpp/.pc/install-cmake-dev-files.patch/CMakeLists.txt' | |||
2439 | --- dist/yaml-cpp/.pc/install-cmake-dev-files.patch/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
2440 | +++ dist/yaml-cpp/.pc/install-cmake-dev-files.patch/CMakeLists.txt 2016-10-18 07:57:32 +0000 | |||
2441 | @@ -0,0 +1,340 @@ | |||
2442 | 1 | ### | ||
2443 | 2 | ### CMake settings | ||
2444 | 3 | ### | ||
2445 | 4 | ## Due to Mac OSX we need to keep compatibility with CMake 2.6 | ||
2446 | 5 | # see http://www.cmake.org/Wiki/CMake_Policies | ||
2447 | 6 | cmake_minimum_required(VERSION 2.6) | ||
2448 | 7 | # see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0012 | ||
2449 | 8 | if(POLICY CMP0012) | ||
2450 | 9 | cmake_policy(SET CMP0012 OLD) | ||
2451 | 10 | endif() | ||
2452 | 11 | # see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0015 | ||
2453 | 12 | if(POLICY CMP0015) | ||
2454 | 13 | cmake_policy(SET CMP0015 OLD) | ||
2455 | 14 | endif() | ||
2456 | 15 | |||
2457 | 16 | include(CheckCXXCompilerFlag) | ||
2458 | 17 | |||
2459 | 18 | |||
2460 | 19 | ### | ||
2461 | 20 | ### Project settings | ||
2462 | 21 | ### | ||
2463 | 22 | project(YAML_CPP) | ||
2464 | 23 | |||
2465 | 24 | set(YAML_CPP_VERSION_MAJOR "0") | ||
2466 | 25 | set(YAML_CPP_VERSION_MINOR "5") | ||
2467 | 26 | set(YAML_CPP_VERSION_PATCH "2") | ||
2468 | 27 | set(YAML_CPP_VERSION "${YAML_CPP_VERSION_MAJOR}.${YAML_CPP_VERSION_MINOR}.${YAML_CPP_VERSION_PATCH}") | ||
2469 | 28 | |||
2470 | 29 | enable_testing() | ||
2471 | 30 | |||
2472 | 31 | |||
2473 | 32 | ### | ||
2474 | 33 | ### Project options | ||
2475 | 34 | ### | ||
2476 | 35 | ## Project stuff | ||
2477 | 36 | option(YAML_CPP_BUILD_TOOLS "Enable testing and parse tools" ON) | ||
2478 | 37 | option(YAML_CPP_BUILD_CONTRIB "Enable contrib stuff in library" ON) | ||
2479 | 38 | |||
2480 | 39 | ## Build options | ||
2481 | 40 | # --> General | ||
2482 | 41 | # see http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:BUILD_SHARED_LIBS | ||
2483 | 42 | # http://www.cmake.org/cmake/help/cmake2.6docs.html#command:add_library | ||
2484 | 43 | option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) | ||
2485 | 44 | |||
2486 | 45 | # --> Apple | ||
2487 | 46 | option(APPLE_UNIVERSAL_BIN "Apple: Build universal binary" OFF) | ||
2488 | 47 | |||
2489 | 48 | # --> Microsoft Visual C++ | ||
2490 | 49 | # see http://msdn.microsoft.com/en-us/library/aa278396(v=VS.60).aspx | ||
2491 | 50 | # http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=VS.71).aspx | ||
2492 | 51 | option(MSVC_SHARED_RT "MSVC: Build with shared runtime libs (/MD)" ON) | ||
2493 | 52 | option(MSVC_STHREADED_RT "MSVC: Build with single-threaded static runtime libs (/ML until VS .NET 2003)" OFF) | ||
2494 | 53 | |||
2495 | 54 | ### | ||
2496 | 55 | ### Sources, headers, directories and libs | ||
2497 | 56 | ### | ||
2498 | 57 | |||
2499 | 58 | # From http://www.cmake.org/pipermail/cmake/2010-March/035992.html: | ||
2500 | 59 | # function to collect all the sources from sub-directories | ||
2501 | 60 | # into a single list | ||
2502 | 61 | function(add_sources) | ||
2503 | 62 | get_property(is_defined GLOBAL PROPERTY SRCS_LIST DEFINED) | ||
2504 | 63 | if(NOT is_defined) | ||
2505 | 64 | define_property(GLOBAL PROPERTY SRCS_LIST | ||
2506 | 65 | BRIEF_DOCS "List of source files" | ||
2507 | 66 | FULL_DOCS "List of all source files in the entire project") | ||
2508 | 67 | endif() | ||
2509 | 68 | # make absolute paths | ||
2510 | 69 | set(SRCS) | ||
2511 | 70 | foreach(s IN LISTS ARGN) | ||
2512 | 71 | if(NOT IS_ABSOLUTE "${s}") | ||
2513 | 72 | get_filename_component(s "${s}" ABSOLUTE) | ||
2514 | 73 | endif() | ||
2515 | 74 | list(APPEND SRCS "${s}") | ||
2516 | 75 | endforeach() | ||
2517 | 76 | # append to global list | ||
2518 | 77 | set_property(GLOBAL APPEND PROPERTY SRCS_LIST "${SRCS}") | ||
2519 | 78 | endfunction(add_sources) | ||
2520 | 79 | |||
2521 | 80 | set(header_directory "include/yaml-cpp/") | ||
2522 | 81 | |||
2523 | 82 | file(GLOB sources "src/[a-zA-Z]*.cpp") | ||
2524 | 83 | file(GLOB_RECURSE public_headers "include/yaml-cpp/[a-zA-Z]*.h") | ||
2525 | 84 | file(GLOB private_headers "src/[a-zA-Z]*.h") | ||
2526 | 85 | |||
2527 | 86 | if(YAML_CPP_BUILD_CONTRIB) | ||
2528 | 87 | file(GLOB contrib_sources "src/contrib/[a-zA-Z]*.cpp") | ||
2529 | 88 | file(GLOB contrib_public_headers "include/yaml-cpp/contrib/[a-zA-Z]*.h") | ||
2530 | 89 | file(GLOB contrib_private_headers "src/contrib/[a-zA-Z]*.h") | ||
2531 | 90 | else() | ||
2532 | 91 | add_definitions(-DYAML_CPP_NO_CONTRIB) | ||
2533 | 92 | endif() | ||
2534 | 93 | |||
2535 | 94 | set(library_sources | ||
2536 | 95 | ${sources} | ||
2537 | 96 | ${public_headers} | ||
2538 | 97 | ${private_headers} | ||
2539 | 98 | ${contrib_sources} | ||
2540 | 99 | ${contrib_public_headers} | ||
2541 | 100 | ${contrib_private_headers} | ||
2542 | 101 | ) | ||
2543 | 102 | add_sources(${library_sources}) | ||
2544 | 103 | |||
2545 | 104 | if(VERBOSE) | ||
2546 | 105 | message(STATUS "sources: ${sources}") | ||
2547 | 106 | message(STATUS "public_headers: ${public_headers}") | ||
2548 | 107 | message(STATUS "private_headers: ${private_headers}") | ||
2549 | 108 | message(STATUS "contrib_sources: ${contrib_sources}") | ||
2550 | 109 | message(STATUS "contrib_public_headers: ${contrib_public_headers}") | ||
2551 | 110 | message(STATUS "contrib_private_headers: ${contrib_private_headers}") | ||
2552 | 111 | endif() | ||
2553 | 112 | |||
2554 | 113 | include_directories(${YAML_CPP_SOURCE_DIR}/src) | ||
2555 | 114 | include_directories(${YAML_CPP_SOURCE_DIR}/include) | ||
2556 | 115 | |||
2557 | 116 | find_package(Boost REQUIRED) | ||
2558 | 117 | include_directories(${Boost_INCLUDE_DIRS}) | ||
2559 | 118 | |||
2560 | 119 | |||
2561 | 120 | ### | ||
2562 | 121 | ### General compilation settings | ||
2563 | 122 | ### | ||
2564 | 123 | set(yaml_c_flags ${CMAKE_C_FLAGS}) | ||
2565 | 124 | set(yaml_cxx_flags ${CMAKE_CXX_FLAGS}) | ||
2566 | 125 | |||
2567 | 126 | if(BUILD_SHARED_LIBS) | ||
2568 | 127 | set(LABEL_SUFFIX "shared") | ||
2569 | 128 | else() | ||
2570 | 129 | set(LABEL_SUFFIX "static") | ||
2571 | 130 | endif() | ||
2572 | 131 | |||
2573 | 132 | if(APPLE) | ||
2574 | 133 | if(APPLE_UNIVERSAL_BIN) | ||
2575 | 134 | set(CMAKE_OSX_ARCHITECTURES ppc;i386) | ||
2576 | 135 | endif() | ||
2577 | 136 | endif() | ||
2578 | 137 | |||
2579 | 138 | if(IPHONE) | ||
2580 | 139 | set(CMAKE_OSX_SYSROOT "iphoneos4.2") | ||
2581 | 140 | set(CMAKE_OSX_ARCHITECTURES "armv6;armv7") | ||
2582 | 141 | endif() | ||
2583 | 142 | |||
2584 | 143 | if(WIN32) | ||
2585 | 144 | if(BUILD_SHARED_LIBS) | ||
2586 | 145 | add_definitions(-D${PROJECT_NAME}_DLL) # use or build Windows DLL | ||
2587 | 146 | endif() | ||
2588 | 147 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
2589 | 148 | set(CMAKE_INSTALL_PREFIX "C:/") | ||
2590 | 149 | endif() | ||
2591 | 150 | endif() | ||
2592 | 151 | |||
2593 | 152 | # GCC or Clang specialities | ||
2594 | 153 | if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR | ||
2595 | 154 | "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") | ||
2596 | 155 | ### General stuff | ||
2597 | 156 | if(WIN32) | ||
2598 | 157 | set(CMAKE_SHARED_LIBRARY_PREFIX "") # DLLs do not have a "lib" prefix | ||
2599 | 158 | set(CMAKE_IMPORT_LIBRARY_PREFIX "") # same for DLL import libs | ||
2600 | 159 | set(CMAKE_LINK_DEF_FILE_FLAG "") # CMake workaround (2.8.3) | ||
2601 | 160 | endif() | ||
2602 | 161 | |||
2603 | 162 | ### Project stuff | ||
2604 | 163 | if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) | ||
2605 | 164 | set(CMAKE_BUILD_TYPE Release) | ||
2606 | 165 | endif() | ||
2607 | 166 | # | ||
2608 | 167 | set(CMAKE_CXX_FLAGS_RELEASE "-O2") | ||
2609 | 168 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") | ||
2610 | 169 | set(CMAKE_CXX_FLAGS_DEBUG "-g") | ||
2611 | 170 | set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os") | ||
2612 | 171 | # | ||
2613 | 172 | set(GCC_EXTRA_OPTIONS "") | ||
2614 | 173 | # | ||
2615 | 174 | set(FLAG_TESTED "-Wextra") | ||
2616 | 175 | check_cxx_compiler_flag(${FLAG_TESTED} FLAG_WEXTRA) | ||
2617 | 176 | if(FLAG_WEXTRA) | ||
2618 | 177 | set(GCC_EXTRA_OPTIONS "${GCC_EXTRA_OPTIONS} ${FLAG_TESTED}") | ||
2619 | 178 | endif() | ||
2620 | 179 | # | ||
2621 | 180 | set(yaml_cxx_flags "-Wall ${GCC_EXTRA_OPTIONS} -pedantic -Wno-long-long ${yaml_cxx_flags}") | ||
2622 | 181 | |||
2623 | 182 | ### Make specific | ||
2624 | 183 | if(${CMAKE_BUILD_TOOL} MATCHES make OR ${CMAKE_BUILD_TOOL} MATCHES gmake) | ||
2625 | 184 | add_custom_target(debuggable $(MAKE) clean | ||
2626 | 185 | COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR} | ||
2627 | 186 | COMMENT "Adjusting settings for debug compilation" | ||
2628 | 187 | VERBATIM) | ||
2629 | 188 | add_custom_target(releasable $(MAKE) clean | ||
2630 | 189 | COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR} | ||
2631 | 190 | COMMENT "Adjusting settings for release compilation" | ||
2632 | 191 | VERBATIM) | ||
2633 | 192 | endif() | ||
2634 | 193 | endif() | ||
2635 | 194 | |||
2636 | 195 | # Microsoft VisualC++ specialities | ||
2637 | 196 | if(MSVC) | ||
2638 | 197 | ### General stuff | ||
2639 | 198 | # a) Change MSVC runtime library settings (/MD[d], /MT[d], /ML[d] (single-threaded until VS 2003)) | ||
2640 | 199 | # plus set lib suffix for later use and project label accordingly | ||
2641 | 200 | # see http://msdn.microsoft.com/en-us/library/aa278396(v=VS.60).aspx | ||
2642 | 201 | # http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=VS.71).aspx | ||
2643 | 202 | set(LIB_RT_SUFFIX "md") # CMake defaults to /MD for MSVC | ||
2644 | 203 | set(LIB_RT_OPTION "/MD") | ||
2645 | 204 | # | ||
2646 | 205 | if(NOT MSVC_SHARED_RT) # User wants to have static runtime libraries (/MT, /ML) | ||
2647 | 206 | if(MSVC_STHREADED_RT) # User wants to have old single-threaded static runtime libraries | ||
2648 | 207 | set(LIB_RT_SUFFIX "ml") | ||
2649 | 208 | set(LIB_RT_OPTION "/ML") | ||
2650 | 209 | if(NOT ${MSVC_VERSION} LESS 1400) | ||
2651 | 210 | message(FATAL_ERROR "Single-threaded static runtime libraries (/ML) only available until VS .NET 2003 (7.1).") | ||
2652 | 211 | endif() | ||
2653 | 212 | else() | ||
2654 | 213 | set(LIB_RT_SUFFIX "mt") | ||
2655 | 214 | set(LIB_RT_OPTION "/MT") | ||
2656 | 215 | endif() | ||
2657 | 216 | |||
2658 | 217 | # correct linker options | ||
2659 | 218 | foreach(flag_var yaml_c_flags yaml_cxx_flags) | ||
2660 | 219 | foreach(config_name "" DEBUG RELEASE MINSIZEREL RELWITHDEBINFO) | ||
2661 | 220 | set(var_name "${flag_var}") | ||
2662 | 221 | if(NOT "${config_name}" STREQUAL "") | ||
2663 | 222 | set(var_name "${var_name}_${config_name}") | ||
2664 | 223 | endif() | ||
2665 | 224 | string(REPLACE "/MD" "${LIB_RT_OPTION}" ${var_name} "${${var_name}}") | ||
2666 | 225 | endforeach() | ||
2667 | 226 | endforeach() | ||
2668 | 227 | endif() | ||
2669 | 228 | # | ||
2670 | 229 | set(LABEL_SUFFIX "${LABEL_SUFFIX} ${LIB_RT_SUFFIX}") | ||
2671 | 230 | |||
2672 | 231 | # b) Change prefix for static libraries | ||
2673 | 232 | set(CMAKE_STATIC_LIBRARY_PREFIX "lib") # to distinguish static libraries from DLL import libs | ||
2674 | 233 | |||
2675 | 234 | # c) Correct suffixes for static libraries | ||
2676 | 235 | if(NOT BUILD_SHARED_LIBS) | ||
2677 | 236 | ### General stuff | ||
2678 | 237 | set(LIB_TARGET_SUFFIX "${LIB_SUFFIX}${LIB_RT_SUFFIX}") | ||
2679 | 238 | endif() | ||
2680 | 239 | |||
2681 | 240 | ### Project stuff | ||
2682 | 241 | # /W3 = set warning level; see http://msdn.microsoft.com/en-us/library/thxezb7y.aspx | ||
2683 | 242 | # /wd4127 = disable warning C4127 "conditional expression is constant"; see http://msdn.microsoft.com/en-us/library/6t66728h.aspx | ||
2684 | 243 | # /wd4355 = disable warning C4355 "'this' : used in base member initializer list"; http://msdn.microsoft.com/en-us/library/3c594ae3.aspx | ||
2685 | 244 | set(yaml_cxx_flags "/W3 /wd4127 /wd4355 ${yaml_cxx_flags}") | ||
2686 | 245 | endif() | ||
2687 | 246 | |||
2688 | 247 | |||
2689 | 248 | ### | ||
2690 | 249 | ### General install settings | ||
2691 | 250 | ### | ||
2692 | 251 | if(WIN32) | ||
2693 | 252 | set(_library_dir bin) # .dll are in PATH, like executables | ||
2694 | 253 | else() | ||
2695 | 254 | set(_library_dir lib) | ||
2696 | 255 | endif() | ||
2697 | 256 | |||
2698 | 257 | set(INCLUDE_INSTALL_ROOT_DIR include) | ||
2699 | 258 | |||
2700 | 259 | set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_ROOT_DIR}/yaml-cpp) | ||
2701 | 260 | set(LIB_INSTALL_DIR "${_library_dir}${LIB_SUFFIX}") | ||
2702 | 261 | |||
2703 | 262 | set(_INSTALL_DESTINATIONS | ||
2704 | 263 | RUNTIME DESTINATION bin | ||
2705 | 264 | LIBRARY DESTINATION ${LIB_INSTALL_DIR} | ||
2706 | 265 | ARCHIVE DESTINATION "lib${LIB_SUFFIX}" | ||
2707 | 266 | ) | ||
2708 | 267 | |||
2709 | 268 | |||
2710 | 269 | ### | ||
2711 | 270 | ### Library | ||
2712 | 271 | ### | ||
2713 | 272 | add_library(yaml-cpp ${library_sources}) | ||
2714 | 273 | set_target_properties(yaml-cpp PROPERTIES | ||
2715 | 274 | COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags}" | ||
2716 | 275 | ) | ||
2717 | 276 | |||
2718 | 277 | set_target_properties(yaml-cpp PROPERTIES | ||
2719 | 278 | VERSION "${YAML_CPP_VERSION}" | ||
2720 | 279 | SOVERSION "${YAML_CPP_VERSION_MAJOR}.${YAML_CPP_VERSION_MINOR}" | ||
2721 | 280 | PROJECT_LABEL "yaml-cpp ${LABEL_SUFFIX}" | ||
2722 | 281 | ) | ||
2723 | 282 | |||
2724 | 283 | if(IPHONE) | ||
2725 | 284 | set_target_properties(yaml-cpp PROPERTIES | ||
2726 | 285 | XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "3.0" | ||
2727 | 286 | ) | ||
2728 | 287 | endif() | ||
2729 | 288 | |||
2730 | 289 | if(MSVC) | ||
2731 | 290 | if(NOT BUILD_SHARED_LIBS) | ||
2732 | 291 | # correct library names | ||
2733 | 292 | set_target_properties(yaml-cpp PROPERTIES | ||
2734 | 293 | DEBUG_POSTFIX "${LIB_TARGET_SUFFIX}d" | ||
2735 | 294 | RELEASE_POSTFIX "${LIB_TARGET_SUFFIX}" | ||
2736 | 295 | MINSIZEREL_POSTFIX "${LIB_TARGET_SUFFIX}" | ||
2737 | 296 | RELWITHDEBINFO_POSTFIX "${LIB_TARGET_SUFFIX}" | ||
2738 | 297 | ) | ||
2739 | 298 | endif() | ||
2740 | 299 | endif() | ||
2741 | 300 | |||
2742 | 301 | install(TARGETS yaml-cpp ${_INSTALL_DESTINATIONS}) | ||
2743 | 302 | install( | ||
2744 | 303 | DIRECTORY ${header_directory} | ||
2745 | 304 | DESTINATION ${INCLUDE_INSTALL_DIR} | ||
2746 | 305 | FILES_MATCHING PATTERN "*.h" | ||
2747 | 306 | ) | ||
2748 | 307 | |||
2749 | 308 | export( | ||
2750 | 309 | TARGETS yaml-cpp | ||
2751 | 310 | FILE "${PROJECT_BINARY_DIR}/yaml-cpp-targets.cmake") | ||
2752 | 311 | export(PACKAGE yaml-cpp) | ||
2753 | 312 | set(EXPORT_TARGETS yaml-cpp CACHE INTERNAL "export targets") | ||
2754 | 313 | |||
2755 | 314 | set(CONFIG_INCLUDE_DIRS "${YAML_CPP_SOURCE_DIR}/include") | ||
2756 | 315 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in | ||
2757 | 316 | "${PROJECT_BINARY_DIR}/yaml-cpp-config.cmake" @ONLY) | ||
2758 | 317 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config-version.cmake.in | ||
2759 | 318 | "${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" @ONLY) | ||
2760 | 319 | |||
2761 | 320 | if(UNIX) | ||
2762 | 321 | set(PC_FILE ${CMAKE_BINARY_DIR}/yaml-cpp.pc) | ||
2763 | 322 | configure_file("yaml-cpp.pc.cmake" ${PC_FILE} @ONLY) | ||
2764 | 323 | install(FILES ${PC_FILE} DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) | ||
2765 | 324 | endif() | ||
2766 | 325 | |||
2767 | 326 | |||
2768 | 327 | ### | ||
2769 | 328 | ### Extras | ||
2770 | 329 | ### | ||
2771 | 330 | if(YAML_CPP_BUILD_TOOLS) | ||
2772 | 331 | add_subdirectory(test) | ||
2773 | 332 | add_subdirectory(util) | ||
2774 | 333 | endif() | ||
2775 | 334 | |||
2776 | 335 | ### Formatting | ||
2777 | 336 | get_property(all_sources GLOBAL PROPERTY SRCS_LIST) | ||
2778 | 337 | add_custom_target(format | ||
2779 | 338 | COMMAND clang-format --style=file -i ${all_sources} | ||
2780 | 339 | COMMENT "Running clang-format" | ||
2781 | 340 | VERBATIM) | ||
2782 | 0 | 341 | ||
2783 | === added directory 'dist/yaml-cpp/.pc/pkgconfig.patch' | |||
2784 | === added file 'dist/yaml-cpp/.pc/pkgconfig.patch/yaml-cpp.pc.cmake' | |||
2785 | --- dist/yaml-cpp/.pc/pkgconfig.patch/yaml-cpp.pc.cmake 1970-01-01 00:00:00 +0000 | |||
2786 | +++ dist/yaml-cpp/.pc/pkgconfig.patch/yaml-cpp.pc.cmake 2016-10-18 07:57:32 +0000 | |||
2787 | @@ -0,0 +1,11 @@ | |||
2788 | 1 | prefix=@CMAKE_INSTALL_PREFIX@ | ||
2789 | 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ | ||
2790 | 3 | libdir=${prefix}/@LIB_INSTALL_DIR@ | ||
2791 | 4 | includedir=${prefix}/@INCLUDE_INSTALL_ROOT_DIR@ | ||
2792 | 5 | |||
2793 | 6 | Name: Yaml-cpp | ||
2794 | 7 | Description: A YAML parser and emitter for C++ | ||
2795 | 8 | Version: @YAML_CPP_VERSION@ | ||
2796 | 9 | Requires: | ||
2797 | 10 | Libs: -L${libdir} -lyaml-cpp | ||
2798 | 11 | Cflags: -I${includedir} | ||
2799 | 0 | 12 | ||
2800 | === added file 'dist/yaml-cpp/CMakeLists.txt' | |||
2801 | --- dist/yaml-cpp/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
2802 | +++ dist/yaml-cpp/CMakeLists.txt 2016-10-18 07:57:32 +0000 | |||
2803 | @@ -0,0 +1,356 @@ | |||
2804 | 1 | ### | ||
2805 | 2 | ### CMake settings | ||
2806 | 3 | ### | ||
2807 | 4 | ## Due to Mac OSX we need to keep compatibility with CMake 2.6 | ||
2808 | 5 | # see http://www.cmake.org/Wiki/CMake_Policies | ||
2809 | 6 | cmake_minimum_required(VERSION 2.6) | ||
2810 | 7 | # see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0012 | ||
2811 | 8 | if(POLICY CMP0012) | ||
2812 | 9 | cmake_policy(SET CMP0012 OLD) | ||
2813 | 10 | endif() | ||
2814 | 11 | # see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0015 | ||
2815 | 12 | if(POLICY CMP0015) | ||
2816 | 13 | cmake_policy(SET CMP0015 OLD) | ||
2817 | 14 | endif() | ||
2818 | 15 | |||
2819 | 16 | include(CheckCXXCompilerFlag) | ||
2820 | 17 | |||
2821 | 18 | |||
2822 | 19 | ### | ||
2823 | 20 | ### Project settings | ||
2824 | 21 | ### | ||
2825 | 22 | project(YAML_CPP) | ||
2826 | 23 | |||
2827 | 24 | set(YAML_CPP_VERSION_MAJOR "0") | ||
2828 | 25 | set(YAML_CPP_VERSION_MINOR "5") | ||
2829 | 26 | set(YAML_CPP_VERSION_PATCH "2") | ||
2830 | 27 | set(YAML_CPP_VERSION "${YAML_CPP_VERSION_MAJOR}.${YAML_CPP_VERSION_MINOR}.${YAML_CPP_VERSION_PATCH}") | ||
2831 | 28 | |||
2832 | 29 | enable_testing() | ||
2833 | 30 | |||
2834 | 31 | |||
2835 | 32 | ### | ||
2836 | 33 | ### Project options | ||
2837 | 34 | ### | ||
2838 | 35 | ## Project stuff | ||
2839 | 36 | option(YAML_CPP_BUILD_TOOLS "Enable testing and parse tools" ON) | ||
2840 | 37 | option(YAML_CPP_BUILD_CONTRIB "Enable contrib stuff in library" ON) | ||
2841 | 38 | |||
2842 | 39 | ## Build options | ||
2843 | 40 | # --> General | ||
2844 | 41 | # see http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:BUILD_SHARED_LIBS | ||
2845 | 42 | # http://www.cmake.org/cmake/help/cmake2.6docs.html#command:add_library | ||
2846 | 43 | option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) | ||
2847 | 44 | |||
2848 | 45 | # --> Apple | ||
2849 | 46 | option(APPLE_UNIVERSAL_BIN "Apple: Build universal binary" OFF) | ||
2850 | 47 | |||
2851 | 48 | # --> Microsoft Visual C++ | ||
2852 | 49 | # see http://msdn.microsoft.com/en-us/library/aa278396(v=VS.60).aspx | ||
2853 | 50 | # http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=VS.71).aspx | ||
2854 | 51 | option(MSVC_SHARED_RT "MSVC: Build with shared runtime libs (/MD)" ON) | ||
2855 | 52 | option(MSVC_STHREADED_RT "MSVC: Build with single-threaded static runtime libs (/ML until VS .NET 2003)" OFF) | ||
2856 | 53 | |||
2857 | 54 | ### | ||
2858 | 55 | ### Sources, headers, directories and libs | ||
2859 | 56 | ### | ||
2860 | 57 | |||
2861 | 58 | # From http://www.cmake.org/pipermail/cmake/2010-March/035992.html: | ||
2862 | 59 | # function to collect all the sources from sub-directories | ||
2863 | 60 | # into a single list | ||
2864 | 61 | function(add_sources) | ||
2865 | 62 | get_property(is_defined GLOBAL PROPERTY SRCS_LIST DEFINED) | ||
2866 | 63 | if(NOT is_defined) | ||
2867 | 64 | define_property(GLOBAL PROPERTY SRCS_LIST | ||
2868 | 65 | BRIEF_DOCS "List of source files" | ||
2869 | 66 | FULL_DOCS "List of all source files in the entire project") | ||
2870 | 67 | endif() | ||
2871 | 68 | # make absolute paths | ||
2872 | 69 | set(SRCS) | ||
2873 | 70 | foreach(s IN LISTS ARGN) | ||
2874 | 71 | if(NOT IS_ABSOLUTE "${s}") | ||
2875 | 72 | get_filename_component(s "${s}" ABSOLUTE) | ||
2876 | 73 | endif() | ||
2877 | 74 | list(APPEND SRCS "${s}") | ||
2878 | 75 | endforeach() | ||
2879 | 76 | # append to global list | ||
2880 | 77 | set_property(GLOBAL APPEND PROPERTY SRCS_LIST "${SRCS}") | ||
2881 | 78 | endfunction(add_sources) | ||
2882 | 79 | |||
2883 | 80 | set(header_directory "include/yaml-cpp/") | ||
2884 | 81 | |||
2885 | 82 | file(GLOB sources "src/[a-zA-Z]*.cpp") | ||
2886 | 83 | file(GLOB_RECURSE public_headers "include/yaml-cpp/[a-zA-Z]*.h") | ||
2887 | 84 | file(GLOB private_headers "src/[a-zA-Z]*.h") | ||
2888 | 85 | |||
2889 | 86 | if(YAML_CPP_BUILD_CONTRIB) | ||
2890 | 87 | file(GLOB contrib_sources "src/contrib/[a-zA-Z]*.cpp") | ||
2891 | 88 | file(GLOB contrib_public_headers "include/yaml-cpp/contrib/[a-zA-Z]*.h") | ||
2892 | 89 | file(GLOB contrib_private_headers "src/contrib/[a-zA-Z]*.h") | ||
2893 | 90 | else() | ||
2894 | 91 | add_definitions(-DYAML_CPP_NO_CONTRIB) | ||
2895 | 92 | endif() | ||
2896 | 93 | |||
2897 | 94 | set(library_sources | ||
2898 | 95 | ${sources} | ||
2899 | 96 | ${public_headers} | ||
2900 | 97 | ${private_headers} | ||
2901 | 98 | ${contrib_sources} | ||
2902 | 99 | ${contrib_public_headers} | ||
2903 | 100 | ${contrib_private_headers} | ||
2904 | 101 | ) | ||
2905 | 102 | add_sources(${library_sources}) | ||
2906 | 103 | |||
2907 | 104 | if(VERBOSE) | ||
2908 | 105 | message(STATUS "sources: ${sources}") | ||
2909 | 106 | message(STATUS "public_headers: ${public_headers}") | ||
2910 | 107 | message(STATUS "private_headers: ${private_headers}") | ||
2911 | 108 | message(STATUS "contrib_sources: ${contrib_sources}") | ||
2912 | 109 | message(STATUS "contrib_public_headers: ${contrib_public_headers}") | ||
2913 | 110 | message(STATUS "contrib_private_headers: ${contrib_private_headers}") | ||
2914 | 111 | endif() | ||
2915 | 112 | |||
2916 | 113 | include_directories(${YAML_CPP_SOURCE_DIR}/src) | ||
2917 | 114 | include_directories(${YAML_CPP_SOURCE_DIR}/include) | ||
2918 | 115 | |||
2919 | 116 | find_package(Boost REQUIRED) | ||
2920 | 117 | include_directories(${Boost_INCLUDE_DIRS}) | ||
2921 | 118 | |||
2922 | 119 | |||
2923 | 120 | ### | ||
2924 | 121 | ### General compilation settings | ||
2925 | 122 | ### | ||
2926 | 123 | set(yaml_c_flags ${CMAKE_C_FLAGS}) | ||
2927 | 124 | set(yaml_cxx_flags ${CMAKE_CXX_FLAGS}) | ||
2928 | 125 | |||
2929 | 126 | if(BUILD_SHARED_LIBS) | ||
2930 | 127 | set(LABEL_SUFFIX "shared") | ||
2931 | 128 | else() | ||
2932 | 129 | set(LABEL_SUFFIX "static") | ||
2933 | 130 | endif() | ||
2934 | 131 | |||
2935 | 132 | if(APPLE) | ||
2936 | 133 | if(APPLE_UNIVERSAL_BIN) | ||
2937 | 134 | set(CMAKE_OSX_ARCHITECTURES ppc;i386) | ||
2938 | 135 | endif() | ||
2939 | 136 | endif() | ||
2940 | 137 | |||
2941 | 138 | if(IPHONE) | ||
2942 | 139 | set(CMAKE_OSX_SYSROOT "iphoneos4.2") | ||
2943 | 140 | set(CMAKE_OSX_ARCHITECTURES "armv6;armv7") | ||
2944 | 141 | endif() | ||
2945 | 142 | |||
2946 | 143 | if(WIN32) | ||
2947 | 144 | if(BUILD_SHARED_LIBS) | ||
2948 | 145 | add_definitions(-D${PROJECT_NAME}_DLL) # use or build Windows DLL | ||
2949 | 146 | endif() | ||
2950 | 147 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
2951 | 148 | set(CMAKE_INSTALL_PREFIX "C:/") | ||
2952 | 149 | endif() | ||
2953 | 150 | endif() | ||
2954 | 151 | |||
2955 | 152 | # GCC or Clang specialities | ||
2956 | 153 | if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR | ||
2957 | 154 | "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") | ||
2958 | 155 | ### General stuff | ||
2959 | 156 | if(WIN32) | ||
2960 | 157 | set(CMAKE_SHARED_LIBRARY_PREFIX "") # DLLs do not have a "lib" prefix | ||
2961 | 158 | set(CMAKE_IMPORT_LIBRARY_PREFIX "") # same for DLL import libs | ||
2962 | 159 | set(CMAKE_LINK_DEF_FILE_FLAG "") # CMake workaround (2.8.3) | ||
2963 | 160 | endif() | ||
2964 | 161 | |||
2965 | 162 | ### Project stuff | ||
2966 | 163 | if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) | ||
2967 | 164 | set(CMAKE_BUILD_TYPE Release) | ||
2968 | 165 | endif() | ||
2969 | 166 | # | ||
2970 | 167 | set(CMAKE_CXX_FLAGS_RELEASE "-O2") | ||
2971 | 168 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") | ||
2972 | 169 | set(CMAKE_CXX_FLAGS_DEBUG "-g") | ||
2973 | 170 | set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os") | ||
2974 | 171 | # | ||
2975 | 172 | set(GCC_EXTRA_OPTIONS "") | ||
2976 | 173 | # | ||
2977 | 174 | set(FLAG_TESTED "-Wextra") | ||
2978 | 175 | check_cxx_compiler_flag(${FLAG_TESTED} FLAG_WEXTRA) | ||
2979 | 176 | if(FLAG_WEXTRA) | ||
2980 | 177 | set(GCC_EXTRA_OPTIONS "${GCC_EXTRA_OPTIONS} ${FLAG_TESTED}") | ||
2981 | 178 | endif() | ||
2982 | 179 | # | ||
2983 | 180 | set(yaml_cxx_flags "-Wall ${GCC_EXTRA_OPTIONS} -pedantic -Wno-long-long ${yaml_cxx_flags}") | ||
2984 | 181 | |||
2985 | 182 | ### Make specific | ||
2986 | 183 | if(${CMAKE_BUILD_TOOL} MATCHES make OR ${CMAKE_BUILD_TOOL} MATCHES gmake) | ||
2987 | 184 | add_custom_target(debuggable $(MAKE) clean | ||
2988 | 185 | COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR} | ||
2989 | 186 | COMMENT "Adjusting settings for debug compilation" | ||
2990 | 187 | VERBATIM) | ||
2991 | 188 | add_custom_target(releasable $(MAKE) clean | ||
2992 | 189 | COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR} | ||
2993 | 190 | COMMENT "Adjusting settings for release compilation" | ||
2994 | 191 | VERBATIM) | ||
2995 | 192 | endif() | ||
2996 | 193 | endif() | ||
2997 | 194 | |||
2998 | 195 | # Microsoft VisualC++ specialities | ||
2999 | 196 | if(MSVC) | ||
3000 | 197 | ### General stuff | ||
3001 | 198 | # a) Change MSVC runtime library settings (/MD[d], /MT[d], /ML[d] (single-threaded until VS 2003)) | ||
3002 | 199 | # plus set lib suffix for later use and project label accordingly | ||
3003 | 200 | # see http://msdn.microsoft.com/en-us/library/aa278396(v=VS.60).aspx | ||
3004 | 201 | # http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=VS.71).aspx | ||
3005 | 202 | set(LIB_RT_SUFFIX "md") # CMake defaults to /MD for MSVC | ||
3006 | 203 | set(LIB_RT_OPTION "/MD") | ||
3007 | 204 | # | ||
3008 | 205 | if(NOT MSVC_SHARED_RT) # User wants to have static runtime libraries (/MT, /ML) | ||
3009 | 206 | if(MSVC_STHREADED_RT) # User wants to have old single-threaded static runtime libraries | ||
3010 | 207 | set(LIB_RT_SUFFIX "ml") | ||
3011 | 208 | set(LIB_RT_OPTION "/ML") | ||
3012 | 209 | if(NOT ${MSVC_VERSION} LESS 1400) | ||
3013 | 210 | message(FATAL_ERROR "Single-threaded static runtime libraries (/ML) only available until VS .NET 2003 (7.1).") | ||
3014 | 211 | endif() | ||
3015 | 212 | else() | ||
3016 | 213 | set(LIB_RT_SUFFIX "mt") | ||
3017 | 214 | set(LIB_RT_OPTION "/MT") | ||
3018 | 215 | endif() | ||
3019 | 216 | |||
3020 | 217 | # correct linker options | ||
3021 | 218 | foreach(flag_var yaml_c_flags yaml_cxx_flags) | ||
3022 | 219 | foreach(config_name "" DEBUG RELEASE MINSIZEREL RELWITHDEBINFO) | ||
3023 | 220 | set(var_name "${flag_var}") | ||
3024 | 221 | if(NOT "${config_name}" STREQUAL "") | ||
3025 | 222 | set(var_name "${var_name}_${config_name}") | ||
3026 | 223 | endif() | ||
3027 | 224 | string(REPLACE "/MD" "${LIB_RT_OPTION}" ${var_name} "${${var_name}}") | ||
3028 | 225 | endforeach() | ||
3029 | 226 | endforeach() | ||
3030 | 227 | endif() | ||
3031 | 228 | # | ||
3032 | 229 | set(LABEL_SUFFIX "${LABEL_SUFFIX} ${LIB_RT_SUFFIX}") | ||
3033 | 230 | |||
3034 | 231 | # b) Change prefix for static libraries | ||
3035 | 232 | set(CMAKE_STATIC_LIBRARY_PREFIX "lib") # to distinguish static libraries from DLL import libs | ||
3036 | 233 | |||
3037 | 234 | # c) Correct suffixes for static libraries | ||
3038 | 235 | if(NOT BUILD_SHARED_LIBS) | ||
3039 | 236 | ### General stuff | ||
3040 | 237 | set(LIB_TARGET_SUFFIX "${LIB_SUFFIX}${LIB_RT_SUFFIX}") | ||
3041 | 238 | endif() | ||
3042 | 239 | |||
3043 | 240 | ### Project stuff | ||
3044 | 241 | # /W3 = set warning level; see http://msdn.microsoft.com/en-us/library/thxezb7y.aspx | ||
3045 | 242 | # /wd4127 = disable warning C4127 "conditional expression is constant"; see http://msdn.microsoft.com/en-us/library/6t66728h.aspx | ||
3046 | 243 | # /wd4355 = disable warning C4355 "'this' : used in base member initializer list"; http://msdn.microsoft.com/en-us/library/3c594ae3.aspx | ||
3047 | 244 | set(yaml_cxx_flags "/W3 /wd4127 /wd4355 ${yaml_cxx_flags}") | ||
3048 | 245 | endif() | ||
3049 | 246 | |||
3050 | 247 | |||
3051 | 248 | ### | ||
3052 | 249 | ### General install settings | ||
3053 | 250 | ### | ||
3054 | 251 | if(WIN32) | ||
3055 | 252 | set(_library_dir bin) # .dll are in PATH, like executables | ||
3056 | 253 | else() | ||
3057 | 254 | set(_library_dir ${CMAKE_INSTALL_PREFIX}/lib) | ||
3058 | 255 | endif() | ||
3059 | 256 | |||
3060 | 257 | set(INCLUDE_INSTALL_ROOT_DIR include) | ||
3061 | 258 | |||
3062 | 259 | set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_ROOT_DIR}/yaml-cpp) | ||
3063 | 260 | SET(LIB_INSTALL_DIR "${_library_dir}${LIB_SUFFIX}" CACHE | ||
3064 | 261 | "Directory relative to CMAKE_INSTALL_PREFIX in which to install libraries" | ||
3065 | 262 | STRING) | ||
3066 | 263 | MARK_AS_ADVANCED(LIB_INSTALL_DIR) | ||
3067 | 264 | |||
3068 | 265 | set(_INSTALL_DESTINATIONS | ||
3069 | 266 | RUNTIME DESTINATION bin | ||
3070 | 267 | LIBRARY DESTINATION ${LIB_INSTALL_DIR} | ||
3071 | 268 | ARCHIVE DESTINATION ${LIB_INSTALL_DIR} | ||
3072 | 269 | ) | ||
3073 | 270 | |||
3074 | 271 | |||
3075 | 272 | ### | ||
3076 | 273 | ### Library | ||
3077 | 274 | ### | ||
3078 | 275 | add_library(yaml-cpp ${library_sources}) | ||
3079 | 276 | set_target_properties(yaml-cpp PROPERTIES | ||
3080 | 277 | COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags}" | ||
3081 | 278 | ) | ||
3082 | 279 | |||
3083 | 280 | set_target_properties(yaml-cpp PROPERTIES | ||
3084 | 281 | VERSION "${YAML_CPP_VERSION}" | ||
3085 | 282 | SOVERSION "${YAML_CPP_VERSION_MAJOR}.${YAML_CPP_VERSION_MINOR}" | ||
3086 | 283 | PROJECT_LABEL "yaml-cpp ${LABEL_SUFFIX}" | ||
3087 | 284 | ) | ||
3088 | 285 | |||
3089 | 286 | if(IPHONE) | ||
3090 | 287 | set_target_properties(yaml-cpp PROPERTIES | ||
3091 | 288 | XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "3.0" | ||
3092 | 289 | ) | ||
3093 | 290 | endif() | ||
3094 | 291 | |||
3095 | 292 | if(MSVC) | ||
3096 | 293 | if(NOT BUILD_SHARED_LIBS) | ||
3097 | 294 | # correct library names | ||
3098 | 295 | set_target_properties(yaml-cpp PROPERTIES | ||
3099 | 296 | DEBUG_POSTFIX "${LIB_TARGET_SUFFIX}d" | ||
3100 | 297 | RELEASE_POSTFIX "${LIB_TARGET_SUFFIX}" | ||
3101 | 298 | MINSIZEREL_POSTFIX "${LIB_TARGET_SUFFIX}" | ||
3102 | 299 | RELWITHDEBINFO_POSTFIX "${LIB_TARGET_SUFFIX}" | ||
3103 | 300 | ) | ||
3104 | 301 | endif() | ||
3105 | 302 | endif() | ||
3106 | 303 | |||
3107 | 304 | install(TARGETS yaml-cpp EXPORT yaml-cpp-targets ${_INSTALL_DESTINATIONS}) | ||
3108 | 305 | install( | ||
3109 | 306 | DIRECTORY ${header_directory} | ||
3110 | 307 | DESTINATION ${INCLUDE_INSTALL_DIR} | ||
3111 | 308 | FILES_MATCHING PATTERN "*.h" | ||
3112 | 309 | ) | ||
3113 | 310 | |||
3114 | 311 | export( | ||
3115 | 312 | TARGETS yaml-cpp | ||
3116 | 313 | FILE "${PROJECT_BINARY_DIR}/yaml-cpp-targets.cmake") | ||
3117 | 314 | export(PACKAGE yaml-cpp) | ||
3118 | 315 | set(EXPORT_TARGETS yaml-cpp CACHE INTERNAL "export targets") | ||
3119 | 316 | |||
3120 | 317 | set(CONFIG_INCLUDE_DIRS "${YAML_CPP_SOURCE_DIR}/include") | ||
3121 | 318 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in | ||
3122 | 319 | "${PROJECT_BINARY_DIR}/yaml-cpp-config.cmake" @ONLY) | ||
3123 | 320 | |||
3124 | 321 | set(INSTALL_CMAKE_DIR ${LIB_INSTALL_DIR}/cmake/yaml-cpp) | ||
3125 | 322 | file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/include") | ||
3126 | 323 | set(CONFIG_INCLUDE_DIRS "\${YAML_CPP_CMAKE_DIR}/${REL_INCLUDE_DIR}") | ||
3127 | 324 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in | ||
3128 | 325 | "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" @ONLY) | ||
3129 | 326 | |||
3130 | 327 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config-version.cmake.in | ||
3131 | 328 | "${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" @ONLY) | ||
3132 | 329 | |||
3133 | 330 | install(FILES | ||
3134 | 331 | "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" | ||
3135 | 332 | "${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" | ||
3136 | 333 | DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev) | ||
3137 | 334 | install(EXPORT yaml-cpp-targets DESTINATION ${INSTALL_CMAKE_DIR}) | ||
3138 | 335 | |||
3139 | 336 | if(UNIX) | ||
3140 | 337 | set(PC_FILE ${CMAKE_BINARY_DIR}/yaml-cpp.pc) | ||
3141 | 338 | configure_file("yaml-cpp.pc.cmake" ${PC_FILE} @ONLY) | ||
3142 | 339 | install(FILES ${PC_FILE} DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) | ||
3143 | 340 | endif() | ||
3144 | 341 | |||
3145 | 342 | |||
3146 | 343 | ### | ||
3147 | 344 | ### Extras | ||
3148 | 345 | ### | ||
3149 | 346 | if(YAML_CPP_BUILD_TOOLS) | ||
3150 | 347 | add_subdirectory(test) | ||
3151 | 348 | add_subdirectory(util) | ||
3152 | 349 | endif() | ||
3153 | 350 | |||
3154 | 351 | ### Formatting | ||
3155 | 352 | get_property(all_sources GLOBAL PROPERTY SRCS_LIST) | ||
3156 | 353 | add_custom_target(format | ||
3157 | 354 | COMMAND clang-format --style=file -i ${all_sources} | ||
3158 | 355 | COMMENT "Running clang-format" | ||
3159 | 356 | VERBATIM) | ||
3160 | 0 | 357 | ||
3161 | === added directory 'dist/yaml-cpp/debian' | |||
3162 | === added file 'dist/yaml-cpp/debian/changelog' | |||
3163 | --- dist/yaml-cpp/debian/changelog 1970-01-01 00:00:00 +0000 | |||
3164 | +++ dist/yaml-cpp/debian/changelog 2016-10-18 07:57:32 +0000 | |||
3165 | @@ -0,0 +1,56 @@ | |||
3166 | 1 | yaml-cpp (0.5.2-3) unstable; urgency=medium | ||
3167 | 2 | |||
3168 | 3 | * Fix error in yaml-cpp-config.cmake | ||
3169 | 4 | * Disable gtest's use of pthread on hurd and kfreebsd | ||
3170 | 5 | |||
3171 | 6 | -- Paul Novotny <paul@paulnovo.us> Mon, 30 Nov 2015 16:53:57 -0500 | ||
3172 | 7 | |||
3173 | 8 | yaml-cpp (0.5.2-2) unstable; urgency=medium | ||
3174 | 9 | |||
3175 | 10 | * Rename libyaml-cpp0.5 to libyaml-cpp0.5v5 for gcc5 transition | ||
3176 | 11 | (Closes: #791317) | ||
3177 | 12 | |||
3178 | 13 | -- Paul Novotny <paul@paulnovo.us> Tue, 04 Aug 2015 18:03:35 -0400 | ||
3179 | 14 | |||
3180 | 15 | yaml-cpp (0.5.2-1) unstable; urgency=medium | ||
3181 | 16 | |||
3182 | 17 | * Update due to yaml-cpp from Google Code to GitHub | ||
3183 | 18 | * Imported Upstream version 0.5.2 | ||
3184 | 19 | * Remove patches/fix-unit-test.patch, applied upstream | ||
3185 | 20 | * Remove patches/remove-conflicting-google-libs.patch, applied upstream | ||
3186 | 21 | |||
3187 | 22 | -- Paul Novotny <paul@paulnovo.us> Thu, 23 Apr 2015 16:40:20 -0400 | ||
3188 | 23 | |||
3189 | 24 | yaml-cpp (0.5.1+hg20150210-1) experimental; urgency=medium | ||
3190 | 25 | |||
3191 | 26 | [ Andreas Tille ] | ||
3192 | 27 | * Import latest upstream | ||
3193 | 28 | * Fix failing unit tests | ||
3194 | 29 | * Inject package into collab-maint to enable more people contributing | ||
3195 | 30 | * cme fix dpkg-control | ||
3196 | 31 | * debhelper 9 | ||
3197 | 32 | |||
3198 | 33 | [ Paul Novotny ] | ||
3199 | 34 | * Add myself as Uploader | ||
3200 | 35 | * Import latest upstream VCS status | ||
3201 | 36 | * Fix failing unit tests, update version number | ||
3202 | 37 | * Install cmake development files | ||
3203 | 38 | |||
3204 | 39 | -- Andreas Tille <tille@debian.org> Mon, 09 Feb 2015 13:36:42 +0100 | ||
3205 | 40 | |||
3206 | 41 | yaml-cpp (0.5.1-1) unstable; urgency=low | ||
3207 | 42 | |||
3208 | 43 | * New upstream release. (Closes: #706708) | ||
3209 | 44 | * Bump Standards-Version to 3.9.4. | ||
3210 | 45 | * libyaml-cpp-dev: remove multiarch path in yaml-cpp.pc to make | ||
3211 | 46 | lintian happy. | ||
3212 | 47 | * debian/copyright: new Format URI. | ||
3213 | 48 | * debian/control: remove Vcs-Svn field. | ||
3214 | 49 | |||
3215 | 50 | -- Lifeng Sun <lifongsun@gmail.com> Fri, 30 Aug 2013 18:29:05 +0800 | ||
3216 | 51 | |||
3217 | 52 | yaml-cpp (0.3.0-1) unstable; urgency=low | ||
3218 | 53 | |||
3219 | 54 | * Initial release (Closes: #636985) | ||
3220 | 55 | |||
3221 | 56 | -- Lifeng Sun <lifongsun@gmail.com> Sun, 03 Jun 2012 23:48:30 +0800 | ||
3222 | 0 | 57 | ||
3223 | === added file 'dist/yaml-cpp/debian/compat' | |||
3224 | --- dist/yaml-cpp/debian/compat 1970-01-01 00:00:00 +0000 | |||
3225 | +++ dist/yaml-cpp/debian/compat 2016-10-18 07:57:32 +0000 | |||
3226 | @@ -0,0 +1,1 @@ | |||
3227 | 1 | 9 | ||
3228 | 0 | 2 | ||
3229 | === added file 'dist/yaml-cpp/debian/control' | |||
3230 | --- dist/yaml-cpp/debian/control 1970-01-01 00:00:00 +0000 | |||
3231 | +++ dist/yaml-cpp/debian/control 2016-10-18 07:57:32 +0000 | |||
3232 | @@ -0,0 +1,39 @@ | |||
3233 | 1 | Source: yaml-cpp | ||
3234 | 2 | Maintainer: Lifeng Sun <lifongsun@gmail.com> | ||
3235 | 3 | Uploaders: Andreas Tille <tille@debian.org>, | ||
3236 | 4 | Paul Novotny <paul@paulnovo.us> | ||
3237 | 5 | Section: devel | ||
3238 | 6 | Priority: optional | ||
3239 | 7 | Build-Depends: debhelper (>= 9), | ||
3240 | 8 | cmake, | ||
3241 | 9 | libboost-dev | ||
3242 | 10 | Standards-Version: 3.9.6 | ||
3243 | 11 | Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/yaml-cpp.git | ||
3244 | 12 | Vcs-Git: git://anonscm.debian.org/collab-maint/yaml-cpp.git | ||
3245 | 13 | Homepage: https://github.com/jbeder/yaml-cpp | ||
3246 | 14 | |||
3247 | 15 | Package: libyaml-cpp0.5v5 | ||
3248 | 16 | Architecture: any | ||
3249 | 17 | Multi-Arch: same | ||
3250 | 18 | Section: libs | ||
3251 | 19 | Depends: ${shlibs:Depends}, | ||
3252 | 20 | ${misc:Depends} | ||
3253 | 21 | Pre-Depends: ${misc:Pre-Depends} | ||
3254 | 22 | Conflicts: libyaml-cpp0.5 | ||
3255 | 23 | Replaces: libyaml-cpp0.5 | ||
3256 | 24 | Description: YAML parser and emitter for C++ | ||
3257 | 25 | yaml-cpp is a C++ library for parsing and emitting data in YAML 1.2, a | ||
3258 | 26 | human-readable data serialization format. | ||
3259 | 27 | . | ||
3260 | 28 | This package provides run-time library of yaml-cpp. | ||
3261 | 29 | |||
3262 | 30 | Package: libyaml-cpp-dev | ||
3263 | 31 | Architecture: any | ||
3264 | 32 | Section: libdevel | ||
3265 | 33 | Depends: libyaml-cpp0.5v5 (= ${binary:Version}), | ||
3266 | 34 | ${misc:Depends} | ||
3267 | 35 | Description: YAML parser and emitter for C++ - development files | ||
3268 | 36 | yaml-cpp is a C++ library for parsing and emitting data in YAML 1.2, a | ||
3269 | 37 | human-readable data serialization format. | ||
3270 | 38 | . | ||
3271 | 39 | This package provides development files of yaml-cpp. | ||
3272 | 0 | 40 | ||
3273 | === added file 'dist/yaml-cpp/debian/copyright' | |||
3274 | --- dist/yaml-cpp/debian/copyright 1970-01-01 00:00:00 +0000 | |||
3275 | +++ dist/yaml-cpp/debian/copyright 2016-10-18 07:57:32 +0000 | |||
3276 | @@ -0,0 +1,44 @@ | |||
3277 | 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
3278 | 2 | Upstream-Name: yaml-cpp | ||
3279 | 3 | Source: https://github.com/jbeder/yaml-cpp | ||
3280 | 4 | |||
3281 | 5 | Files: * | ||
3282 | 6 | Copyright: 2008 Jesse Beder <jbeder@gmail.com> | ||
3283 | 7 | License: X11 | ||
3284 | 8 | Permission is hereby granted, free of charge, to any person obtaining a | ||
3285 | 9 | copy of this software and associated documentation files (the "Software"), | ||
3286 | 10 | to deal in the Software without restriction, including without limitation | ||
3287 | 11 | the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
3288 | 12 | and/or sell copies of the Software, and to permit persons to whom the | ||
3289 | 13 | Software is furnished to do so, subject to the following conditions: | ||
3290 | 14 | . | ||
3291 | 15 | The above copyright notice and this permission notice shall be included | ||
3292 | 16 | in all copies or substantial portions of the Software. | ||
3293 | 17 | . | ||
3294 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
3295 | 19 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
3296 | 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
3297 | 21 | IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
3298 | 22 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
3299 | 23 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
3300 | 24 | OTHER DEALINGS IN THE SOFTWARE. | ||
3301 | 25 | |||
3302 | 26 | Files: debian/* | ||
3303 | 27 | Copyright: 2011-2013 Lifeng Sun <lifongsun@gmail.com> | ||
3304 | 28 | License: GPL-2.0+ | ||
3305 | 29 | This package is free software; you can redistribute it and/or modify | ||
3306 | 30 | it under the terms of the GNU General Public License as published by | ||
3307 | 31 | the Free Software Foundation; either version 2 of the License, or | ||
3308 | 32 | (at your option) any later version. | ||
3309 | 33 | . | ||
3310 | 34 | This package is distributed in the hope that it will be useful, | ||
3311 | 35 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3312 | 36 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3313 | 37 | GNU General Public License for more details. | ||
3314 | 38 | . | ||
3315 | 39 | You should have received a copy of the GNU General Public License | ||
3316 | 40 | along with this program. If not, see <http://www.gnu.org/licenses/> | ||
3317 | 41 | . | ||
3318 | 42 | On Debian systems, the complete text of the GNU General | ||
3319 | 43 | Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". | ||
3320 | 44 | |||
3321 | 0 | 45 | ||
3322 | === added file 'dist/yaml-cpp/debian/libyaml-cpp-dev.install' | |||
3323 | --- dist/yaml-cpp/debian/libyaml-cpp-dev.install 1970-01-01 00:00:00 +0000 | |||
3324 | +++ dist/yaml-cpp/debian/libyaml-cpp-dev.install 2016-10-18 07:57:32 +0000 | |||
3325 | @@ -0,0 +1,5 @@ | |||
3326 | 1 | usr/include/ | ||
3327 | 2 | usr/lib/*/*.a | ||
3328 | 3 | usr/lib/*/*.so | ||
3329 | 4 | usr/lib/*/pkgconfig/ | ||
3330 | 5 | usr/lib/*/cmake/ | ||
3331 | 0 | 6 | ||
3332 | === added file 'dist/yaml-cpp/debian/libyaml-cpp0.5v5.install' | |||
3333 | --- dist/yaml-cpp/debian/libyaml-cpp0.5v5.install 1970-01-01 00:00:00 +0000 | |||
3334 | +++ dist/yaml-cpp/debian/libyaml-cpp0.5v5.install 2016-10-18 07:57:32 +0000 | |||
3335 | @@ -0,0 +1,1 @@ | |||
3336 | 1 | usr/lib/*/libyaml-cpp.so.* | ||
3337 | 0 | 2 | ||
3338 | === added directory 'dist/yaml-cpp/debian/patches' | |||
3339 | === added file 'dist/yaml-cpp/debian/patches/install-cmake-dev-files.patch' | |||
3340 | --- dist/yaml-cpp/debian/patches/install-cmake-dev-files.patch 1970-01-01 00:00:00 +0000 | |||
3341 | +++ dist/yaml-cpp/debian/patches/install-cmake-dev-files.patch 2016-10-18 07:57:32 +0000 | |||
3342 | @@ -0,0 +1,69 @@ | |||
3343 | 1 | Description: Install libs and cmake files to the Debian location | ||
3344 | 2 | Instead of moving the libs to the DEB_HOST_MULTIARCH lib directory during | ||
3345 | 3 | packaging, have cmake install the libs directly. This is needed so the CMake | ||
3346 | 4 | development files point to the correct location for the libs. Also, install | ||
3347 | 5 | yaml-cpp-config.cmake, yaml-cpp-config-version.cmake, and | ||
3348 | 6 | yaml-cpp-targets.cmake. | ||
3349 | 7 | Author: Paul Novotny <paul@paulnovo.us> | ||
3350 | 8 | Forwarded: not-needed | ||
3351 | 9 | Last-Update: 2015-11-29 | ||
3352 | 10 | |||
3353 | 11 | --- a/CMakeLists.txt | ||
3354 | 12 | +++ b/CMakeLists.txt | ||
3355 | 13 | @@ -251,18 +251,21 @@ | ||
3356 | 14 | if(WIN32) | ||
3357 | 15 | set(_library_dir bin) # .dll are in PATH, like executables | ||
3358 | 16 | else() | ||
3359 | 17 | - set(_library_dir lib) | ||
3360 | 18 | + set(_library_dir ${CMAKE_INSTALL_PREFIX}/lib) | ||
3361 | 19 | endif() | ||
3362 | 20 | |||
3363 | 21 | set(INCLUDE_INSTALL_ROOT_DIR include) | ||
3364 | 22 | |||
3365 | 23 | set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_ROOT_DIR}/yaml-cpp) | ||
3366 | 24 | -set(LIB_INSTALL_DIR "${_library_dir}${LIB_SUFFIX}") | ||
3367 | 25 | +SET(LIB_INSTALL_DIR "${_library_dir}${LIB_SUFFIX}" CACHE | ||
3368 | 26 | + "Directory relative to CMAKE_INSTALL_PREFIX in which to install libraries" | ||
3369 | 27 | + STRING) | ||
3370 | 28 | +MARK_AS_ADVANCED(LIB_INSTALL_DIR) | ||
3371 | 29 | |||
3372 | 30 | set(_INSTALL_DESTINATIONS | ||
3373 | 31 | RUNTIME DESTINATION bin | ||
3374 | 32 | LIBRARY DESTINATION ${LIB_INSTALL_DIR} | ||
3375 | 33 | - ARCHIVE DESTINATION "lib${LIB_SUFFIX}" | ||
3376 | 34 | + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} | ||
3377 | 35 | ) | ||
3378 | 36 | |||
3379 | 37 | |||
3380 | 38 | @@ -298,7 +301,7 @@ | ||
3381 | 39 | endif() | ||
3382 | 40 | endif() | ||
3383 | 41 | |||
3384 | 42 | -install(TARGETS yaml-cpp ${_INSTALL_DESTINATIONS}) | ||
3385 | 43 | +install(TARGETS yaml-cpp EXPORT yaml-cpp-targets ${_INSTALL_DESTINATIONS}) | ||
3386 | 44 | install( | ||
3387 | 45 | DIRECTORY ${header_directory} | ||
3388 | 46 | DESTINATION ${INCLUDE_INSTALL_DIR} | ||
3389 | 47 | @@ -314,9 +317,22 @@ | ||
3390 | 48 | set(CONFIG_INCLUDE_DIRS "${YAML_CPP_SOURCE_DIR}/include") | ||
3391 | 49 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in | ||
3392 | 50 | "${PROJECT_BINARY_DIR}/yaml-cpp-config.cmake" @ONLY) | ||
3393 | 51 | + | ||
3394 | 52 | +set(INSTALL_CMAKE_DIR ${LIB_INSTALL_DIR}/cmake/yaml-cpp) | ||
3395 | 53 | +file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/include") | ||
3396 | 54 | +set(CONFIG_INCLUDE_DIRS "\${YAML_CPP_CMAKE_DIR}/${REL_INCLUDE_DIR}") | ||
3397 | 55 | +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in | ||
3398 | 56 | + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" @ONLY) | ||
3399 | 57 | + | ||
3400 | 58 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config-version.cmake.in | ||
3401 | 59 | "${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" @ONLY) | ||
3402 | 60 | |||
3403 | 61 | +install(FILES | ||
3404 | 62 | + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" | ||
3405 | 63 | + "${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" | ||
3406 | 64 | + DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev) | ||
3407 | 65 | +install(EXPORT yaml-cpp-targets DESTINATION ${INSTALL_CMAKE_DIR}) | ||
3408 | 66 | + | ||
3409 | 67 | if(UNIX) | ||
3410 | 68 | set(PC_FILE ${CMAKE_BINARY_DIR}/yaml-cpp.pc) | ||
3411 | 69 | configure_file("yaml-cpp.pc.cmake" ${PC_FILE} @ONLY) | ||
3412 | 0 | 70 | ||
3413 | === added file 'dist/yaml-cpp/debian/patches/pkgconfig.patch' | |||
3414 | --- dist/yaml-cpp/debian/patches/pkgconfig.patch 1970-01-01 00:00:00 +0000 | |||
3415 | +++ dist/yaml-cpp/debian/patches/pkgconfig.patch 2016-10-18 07:57:32 +0000 | |||
3416 | @@ -0,0 +1,19 @@ | |||
3417 | 1 | Author: Lifeng Sun <lifongsun@gmail.com> | ||
3418 | 2 | Last-Update: Fri, 30 Aug 2013 18:29:05 +0800 | ||
3419 | 3 | Description: remove multiarch path in yaml-cpp.pc | ||
3420 | 4 | |||
3421 | 5 | --- a/yaml-cpp.pc.cmake | ||
3422 | 6 | +++ b/yaml-cpp.pc.cmake | ||
3423 | 7 | @@ -1,11 +1,10 @@ | ||
3424 | 8 | prefix=@CMAKE_INSTALL_PREFIX@ | ||
3425 | 9 | exec_prefix=@CMAKE_INSTALL_PREFIX@ | ||
3426 | 10 | -libdir=${prefix}/@LIB_INSTALL_DIR@ | ||
3427 | 11 | includedir=${prefix}/@INCLUDE_INSTALL_ROOT_DIR@ | ||
3428 | 12 | |||
3429 | 13 | Name: Yaml-cpp | ||
3430 | 14 | Description: A YAML parser and emitter for C++ | ||
3431 | 15 | Version: @YAML_CPP_VERSION@ | ||
3432 | 16 | Requires: | ||
3433 | 17 | -Libs: -L${libdir} -lyaml-cpp | ||
3434 | 18 | +Libs: -lyaml-cpp | ||
3435 | 19 | Cflags: -I${includedir} | ||
3436 | 0 | 20 | ||
3437 | === added file 'dist/yaml-cpp/debian/patches/series' | |||
3438 | --- dist/yaml-cpp/debian/patches/series 1970-01-01 00:00:00 +0000 | |||
3439 | +++ dist/yaml-cpp/debian/patches/series 2016-10-18 07:57:32 +0000 | |||
3440 | @@ -0,0 +1,2 @@ | |||
3441 | 1 | pkgconfig.patch | ||
3442 | 2 | install-cmake-dev-files.patch | ||
3443 | 0 | 3 | ||
3444 | === added file 'dist/yaml-cpp/debian/rules' | |||
3445 | --- dist/yaml-cpp/debian/rules 1970-01-01 00:00:00 +0000 | |||
3446 | +++ dist/yaml-cpp/debian/rules 2016-10-18 07:57:32 +0000 | |||
3447 | @@ -0,0 +1,64 @@ | |||
3448 | 1 | #!/usr/bin/make -f | ||
3449 | 2 | |||
3450 | 3 | # Uncomment this to turn on verbose mode. | ||
3451 | 4 | #export DH_VERBOSE=1 | ||
3452 | 5 | |||
3453 | 6 | # This has to be exported to make some magic below work. | ||
3454 | 7 | export DH_OPTIONS | ||
3455 | 8 | |||
3456 | 9 | DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) | ||
3457 | 10 | |||
3458 | 11 | CPPFLAGS :=$(shell dpkg-buildflags --get CPPFLAGS) | ||
3459 | 12 | CFLAGS :=$(shell dpkg-buildflags --get CFLAGS) | ||
3460 | 13 | CXXFLAGS :=$(shell dpkg-buildflags --get CXXFLAGS) | ||
3461 | 14 | LDFLAGS :=$(shell dpkg-buildflags --get LDFLAGS) | ||
3462 | 15 | |||
3463 | 16 | export DEB_HOST_MULTIARCH CPPFLAGS CFLAGS CXXFLAGS LDFLAGS | ||
3464 | 17 | |||
3465 | 18 | ifeq (,$(filter $(DEB_BUILD_ARCH),kfreebsd-amd64 kfreebsd-i386 hurd-i386)) | ||
3466 | 19 | DISABLE_PTHREADS=OFF | ||
3467 | 20 | else | ||
3468 | 21 | DISABLE_PTHREADS=ON | ||
3469 | 22 | endif | ||
3470 | 23 | |||
3471 | 24 | override_dh_auto_configure: | ||
3472 | 25 | dh_testdir | ||
3473 | 26 | mkdir build-static; cd build-static; \ | ||
3474 | 27 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ | ||
3475 | 28 | -DLIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \ | ||
3476 | 29 | -DYAML_CPP_BUILD_TOOLS=ON \ | ||
3477 | 30 | -Dgtest_disable_pthreads=$(DISABLE_PTHREADS) | ||
3478 | 31 | mkdir build-shared; cd build-shared; \ | ||
3479 | 32 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ | ||
3480 | 33 | -DLIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \ | ||
3481 | 34 | -DBUILD_SHARED_LIBS=ON \ | ||
3482 | 35 | -DYAML_CPP_BUILD_TOOLS=ON \ | ||
3483 | 36 | -Dgtest_disable_pthreads=$(DISABLE_PTHREADS) | ||
3484 | 37 | |||
3485 | 38 | override_dh_auto_build: | ||
3486 | 39 | dh_testdir | ||
3487 | 40 | $(MAKE) -C build-static | ||
3488 | 41 | $(MAKE) -C build-shared | ||
3489 | 42 | # It might make sense to also provide the utils in a separate package | ||
3490 | 43 | # $(MAKE) -C build-shared util | ||
3491 | 44 | |||
3492 | 45 | override_dh_auto_install: | ||
3493 | 46 | dh_testdir | ||
3494 | 47 | dh_prep | ||
3495 | 48 | $(MAKE) -C build-static install DESTDIR=$(CURDIR)/debian/tmp | ||
3496 | 49 | $(MAKE) -C build-shared install DESTDIR=$(CURDIR)/debian/tmp | ||
3497 | 50 | |||
3498 | 51 | override_dh_auto_test: | ||
3499 | 52 | $(MAKE) -C build-static test | ||
3500 | 53 | $(MAKE) -C build-shared test | ||
3501 | 54 | |||
3502 | 55 | clean: | ||
3503 | 56 | dh_testdir | ||
3504 | 57 | dh_auto_clean | ||
3505 | 58 | dh_clean | ||
3506 | 59 | rm -rf build-static build-shared | ||
3507 | 60 | |||
3508 | 61 | %: | ||
3509 | 62 | dh $@ | ||
3510 | 63 | |||
3511 | 64 | .PHONY: clean | ||
3512 | 0 | 65 | ||
3513 | === added directory 'dist/yaml-cpp/debian/source' | |||
3514 | === added file 'dist/yaml-cpp/debian/source/format' | |||
3515 | --- dist/yaml-cpp/debian/source/format 1970-01-01 00:00:00 +0000 | |||
3516 | +++ dist/yaml-cpp/debian/source/format 2016-10-18 07:57:32 +0000 | |||
3517 | @@ -0,0 +1,1 @@ | |||
3518 | 1 | 3.0 (quilt) | ||
3519 | 0 | 2 | ||
3520 | === added file 'dist/yaml-cpp/debian/watch' | |||
3521 | --- dist/yaml-cpp/debian/watch 1970-01-01 00:00:00 +0000 | |||
3522 | +++ dist/yaml-cpp/debian/watch 2016-10-18 07:57:32 +0000 | |||
3523 | @@ -0,0 +1,3 @@ | |||
3524 | 1 | version=3 | ||
3525 | 2 | opts=filenamemangle=s/.+\/release-?(\d\S*)\.tar\.gz/yaml-cpp-$1\.tar\.gz/ \ | ||
3526 | 3 | https://github.com/jbeder/yaml-cpp/releases .*/release-?(\d\S*)\.tar\.gz | ||
3527 | 0 | 4 | ||
3528 | === added directory 'dist/yaml-cpp/include' | |||
3529 | === added directory 'dist/yaml-cpp/include/yaml-cpp' | |||
3530 | === added file 'dist/yaml-cpp/include/yaml-cpp/anchor.h' | |||
3531 | --- dist/yaml-cpp/include/yaml-cpp/anchor.h 1970-01-01 00:00:00 +0000 | |||
3532 | +++ dist/yaml-cpp/include/yaml-cpp/anchor.h 2016-10-18 07:57:32 +0000 | |||
3533 | @@ -0,0 +1,17 @@ | |||
3534 | 1 | #ifndef ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3535 | 2 | #define ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3536 | 3 | |||
3537 | 4 | #if defined(_MSC_VER) || \ | ||
3538 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
3539 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
3540 | 7 | #pragma once | ||
3541 | 8 | #endif | ||
3542 | 9 | |||
3543 | 10 | #include <cstddef> | ||
3544 | 11 | |||
3545 | 12 | namespace YAML { | ||
3546 | 13 | typedef std::size_t anchor_t; | ||
3547 | 14 | const anchor_t NullAnchor = 0; | ||
3548 | 15 | } | ||
3549 | 16 | |||
3550 | 17 | #endif // ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3551 | 0 | 18 | ||
3552 | === added file 'dist/yaml-cpp/include/yaml-cpp/binary.h' | |||
3553 | --- dist/yaml-cpp/include/yaml-cpp/binary.h 1970-01-01 00:00:00 +0000 | |||
3554 | +++ dist/yaml-cpp/include/yaml-cpp/binary.h 2016-10-18 07:57:32 +0000 | |||
3555 | @@ -0,0 +1,67 @@ | |||
3556 | 1 | #ifndef BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3557 | 2 | #define BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3558 | 3 | |||
3559 | 4 | #if defined(_MSC_VER) || \ | ||
3560 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
3561 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
3562 | 7 | #pragma once | ||
3563 | 8 | #endif | ||
3564 | 9 | |||
3565 | 10 | #include <string> | ||
3566 | 11 | #include <vector> | ||
3567 | 12 | |||
3568 | 13 | #include "yaml-cpp/dll.h" | ||
3569 | 14 | |||
3570 | 15 | namespace YAML { | ||
3571 | 16 | YAML_CPP_API std::string EncodeBase64(const unsigned char *data, | ||
3572 | 17 | std::size_t size); | ||
3573 | 18 | YAML_CPP_API std::vector<unsigned char> DecodeBase64(const std::string &input); | ||
3574 | 19 | |||
3575 | 20 | class YAML_CPP_API Binary { | ||
3576 | 21 | public: | ||
3577 | 22 | Binary() : m_unownedData(0), m_unownedSize(0) {} | ||
3578 | 23 | Binary(const unsigned char *data_, std::size_t size_) | ||
3579 | 24 | : m_unownedData(data_), m_unownedSize(size_) {} | ||
3580 | 25 | |||
3581 | 26 | bool owned() const { return !m_unownedData; } | ||
3582 | 27 | std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; } | ||
3583 | 28 | const unsigned char *data() const { | ||
3584 | 29 | return owned() ? &m_data[0] : m_unownedData; | ||
3585 | 30 | } | ||
3586 | 31 | |||
3587 | 32 | void swap(std::vector<unsigned char> &rhs) { | ||
3588 | 33 | if (m_unownedData) { | ||
3589 | 34 | m_data.swap(rhs); | ||
3590 | 35 | rhs.clear(); | ||
3591 | 36 | rhs.resize(m_unownedSize); | ||
3592 | 37 | std::copy(m_unownedData, m_unownedData + m_unownedSize, rhs.begin()); | ||
3593 | 38 | m_unownedData = 0; | ||
3594 | 39 | m_unownedSize = 0; | ||
3595 | 40 | } else { | ||
3596 | 41 | m_data.swap(rhs); | ||
3597 | 42 | } | ||
3598 | 43 | } | ||
3599 | 44 | |||
3600 | 45 | bool operator==(const Binary &rhs) const { | ||
3601 | 46 | const std::size_t s = size(); | ||
3602 | 47 | if (s != rhs.size()) | ||
3603 | 48 | return false; | ||
3604 | 49 | const unsigned char *d1 = data(); | ||
3605 | 50 | const unsigned char *d2 = rhs.data(); | ||
3606 | 51 | for (std::size_t i = 0; i < s; i++) { | ||
3607 | 52 | if (*d1++ != *d2++) | ||
3608 | 53 | return false; | ||
3609 | 54 | } | ||
3610 | 55 | return true; | ||
3611 | 56 | } | ||
3612 | 57 | |||
3613 | 58 | bool operator!=(const Binary &rhs) const { return !(*this == rhs); } | ||
3614 | 59 | |||
3615 | 60 | private: | ||
3616 | 61 | std::vector<unsigned char> m_data; | ||
3617 | 62 | const unsigned char *m_unownedData; | ||
3618 | 63 | std::size_t m_unownedSize; | ||
3619 | 64 | }; | ||
3620 | 65 | } | ||
3621 | 66 | |||
3622 | 67 | #endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3623 | 0 | 68 | ||
3624 | === added directory 'dist/yaml-cpp/include/yaml-cpp/contrib' | |||
3625 | === added file 'dist/yaml-cpp/include/yaml-cpp/contrib/anchordict.h' | |||
3626 | --- dist/yaml-cpp/include/yaml-cpp/contrib/anchordict.h 1970-01-01 00:00:00 +0000 | |||
3627 | +++ dist/yaml-cpp/include/yaml-cpp/contrib/anchordict.h 2016-10-18 07:57:32 +0000 | |||
3628 | @@ -0,0 +1,37 @@ | |||
3629 | 1 | #ifndef ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3630 | 2 | #define ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3631 | 3 | |||
3632 | 4 | #if defined(_MSC_VER) || \ | ||
3633 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
3634 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
3635 | 7 | #pragma once | ||
3636 | 8 | #endif | ||
3637 | 9 | |||
3638 | 10 | #include <vector> | ||
3639 | 11 | |||
3640 | 12 | #include "../anchor.h" | ||
3641 | 13 | |||
3642 | 14 | namespace YAML { | ||
3643 | 15 | /// AnchorDict | ||
3644 | 16 | /// . An object that stores and retrieves values correlating to anchor_t | ||
3645 | 17 | /// values. | ||
3646 | 18 | /// . Efficient implementation that can make assumptions about how anchor_t | ||
3647 | 19 | /// values are assigned by the Parser class. | ||
3648 | 20 | template <class T> | ||
3649 | 21 | class AnchorDict { | ||
3650 | 22 | public: | ||
3651 | 23 | void Register(anchor_t anchor, T value) { | ||
3652 | 24 | if (anchor > m_data.size()) { | ||
3653 | 25 | m_data.resize(anchor); | ||
3654 | 26 | } | ||
3655 | 27 | m_data[anchor - 1] = value; | ||
3656 | 28 | } | ||
3657 | 29 | |||
3658 | 30 | T Get(anchor_t anchor) const { return m_data[anchor - 1]; } | ||
3659 | 31 | |||
3660 | 32 | private: | ||
3661 | 33 | std::vector<T> m_data; | ||
3662 | 34 | }; | ||
3663 | 35 | } | ||
3664 | 36 | |||
3665 | 37 | #endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3666 | 0 | 38 | ||
3667 | === added file 'dist/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h' | |||
3668 | --- dist/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h 1970-01-01 00:00:00 +0000 | |||
3669 | +++ dist/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h 2016-10-18 07:57:32 +0000 | |||
3670 | @@ -0,0 +1,147 @@ | |||
3671 | 1 | #ifndef GRAPHBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3672 | 2 | #define GRAPHBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3673 | 3 | |||
3674 | 4 | #if defined(_MSC_VER) || \ | ||
3675 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
3676 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
3677 | 7 | #pragma once | ||
3678 | 8 | #endif | ||
3679 | 9 | |||
3680 | 10 | #include "yaml-cpp/mark.h" | ||
3681 | 11 | #include <string> | ||
3682 | 12 | |||
3683 | 13 | namespace YAML { | ||
3684 | 14 | class Parser; | ||
3685 | 15 | |||
3686 | 16 | // GraphBuilderInterface | ||
3687 | 17 | // . Abstraction of node creation | ||
3688 | 18 | // . pParentNode is always NULL or the return value of one of the NewXXX() | ||
3689 | 19 | // functions. | ||
3690 | 20 | class GraphBuilderInterface { | ||
3691 | 21 | public: | ||
3692 | 22 | // Create and return a new node with a null value. | ||
3693 | 23 | virtual void *NewNull(const Mark &mark, void *pParentNode) = 0; | ||
3694 | 24 | |||
3695 | 25 | // Create and return a new node with the given tag and value. | ||
3696 | 26 | virtual void *NewScalar(const Mark &mark, const std::string &tag, | ||
3697 | 27 | void *pParentNode, const std::string &value) = 0; | ||
3698 | 28 | |||
3699 | 29 | // Create and return a new sequence node | ||
3700 | 30 | virtual void *NewSequence(const Mark &mark, const std::string &tag, | ||
3701 | 31 | void *pParentNode) = 0; | ||
3702 | 32 | |||
3703 | 33 | // Add pNode to pSequence. pNode was created with one of the NewXxx() | ||
3704 | 34 | // functions and pSequence with NewSequence(). | ||
3705 | 35 | virtual void AppendToSequence(void *pSequence, void *pNode) = 0; | ||
3706 | 36 | |||
3707 | 37 | // Note that no moew entries will be added to pSequence | ||
3708 | 38 | virtual void SequenceComplete(void *pSequence) { (void)pSequence; } | ||
3709 | 39 | |||
3710 | 40 | // Create and return a new map node | ||
3711 | 41 | virtual void *NewMap(const Mark &mark, const std::string &tag, | ||
3712 | 42 | void *pParentNode) = 0; | ||
3713 | 43 | |||
3714 | 44 | // Add the pKeyNode => pValueNode mapping to pMap. pKeyNode and pValueNode | ||
3715 | 45 | // were created with one of the NewXxx() methods and pMap with NewMap(). | ||
3716 | 46 | virtual void AssignInMap(void *pMap, void *pKeyNode, void *pValueNode) = 0; | ||
3717 | 47 | |||
3718 | 48 | // Note that no more assignments will be made in pMap | ||
3719 | 49 | virtual void MapComplete(void *pMap) { (void)pMap; } | ||
3720 | 50 | |||
3721 | 51 | // Return the node that should be used in place of an alias referencing | ||
3722 | 52 | // pNode (pNode by default) | ||
3723 | 53 | virtual void *AnchorReference(const Mark &mark, void *pNode) { | ||
3724 | 54 | (void)mark; | ||
3725 | 55 | return pNode; | ||
3726 | 56 | } | ||
3727 | 57 | }; | ||
3728 | 58 | |||
3729 | 59 | // Typesafe wrapper for GraphBuilderInterface. Assumes that Impl defines | ||
3730 | 60 | // Node, Sequence, and Map types. Sequence and Map must derive from Node | ||
3731 | 61 | // (unless Node is defined as void). Impl must also implement function with | ||
3732 | 62 | // all of the same names as the virtual functions in GraphBuilderInterface | ||
3733 | 63 | // -- including the ones with default implementations -- but with the | ||
3734 | 64 | // prototypes changed to accept an explicit Node*, Sequence*, or Map* where | ||
3735 | 65 | // appropriate. | ||
3736 | 66 | template <class Impl> | ||
3737 | 67 | class GraphBuilder : public GraphBuilderInterface { | ||
3738 | 68 | public: | ||
3739 | 69 | typedef typename Impl::Node Node; | ||
3740 | 70 | typedef typename Impl::Sequence Sequence; | ||
3741 | 71 | typedef typename Impl::Map Map; | ||
3742 | 72 | |||
3743 | 73 | GraphBuilder(Impl &impl) : m_impl(impl) { | ||
3744 | 74 | Map *pMap = NULL; | ||
3745 | 75 | Sequence *pSeq = NULL; | ||
3746 | 76 | Node *pNode = NULL; | ||
3747 | 77 | |||
3748 | 78 | // Type consistency checks | ||
3749 | 79 | pNode = pMap; | ||
3750 | 80 | pNode = pSeq; | ||
3751 | 81 | } | ||
3752 | 82 | |||
3753 | 83 | GraphBuilderInterface &AsBuilderInterface() { return *this; } | ||
3754 | 84 | |||
3755 | 85 | virtual void *NewNull(const Mark &mark, void *pParentNode) { | ||
3756 | 86 | return CheckType<Node>(m_impl.NewNull(mark, AsNode(pParentNode))); | ||
3757 | 87 | } | ||
3758 | 88 | |||
3759 | 89 | virtual void *NewScalar(const Mark &mark, const std::string &tag, | ||
3760 | 90 | void *pParentNode, const std::string &value) { | ||
3761 | 91 | return CheckType<Node>( | ||
3762 | 92 | m_impl.NewScalar(mark, tag, AsNode(pParentNode), value)); | ||
3763 | 93 | } | ||
3764 | 94 | |||
3765 | 95 | virtual void *NewSequence(const Mark &mark, const std::string &tag, | ||
3766 | 96 | void *pParentNode) { | ||
3767 | 97 | return CheckType<Sequence>( | ||
3768 | 98 | m_impl.NewSequence(mark, tag, AsNode(pParentNode))); | ||
3769 | 99 | } | ||
3770 | 100 | virtual void AppendToSequence(void *pSequence, void *pNode) { | ||
3771 | 101 | m_impl.AppendToSequence(AsSequence(pSequence), AsNode(pNode)); | ||
3772 | 102 | } | ||
3773 | 103 | virtual void SequenceComplete(void *pSequence) { | ||
3774 | 104 | m_impl.SequenceComplete(AsSequence(pSequence)); | ||
3775 | 105 | } | ||
3776 | 106 | |||
3777 | 107 | virtual void *NewMap(const Mark &mark, const std::string &tag, | ||
3778 | 108 | void *pParentNode) { | ||
3779 | 109 | return CheckType<Map>(m_impl.NewMap(mark, tag, AsNode(pParentNode))); | ||
3780 | 110 | } | ||
3781 | 111 | virtual void AssignInMap(void *pMap, void *pKeyNode, void *pValueNode) { | ||
3782 | 112 | m_impl.AssignInMap(AsMap(pMap), AsNode(pKeyNode), AsNode(pValueNode)); | ||
3783 | 113 | } | ||
3784 | 114 | virtual void MapComplete(void *pMap) { m_impl.MapComplete(AsMap(pMap)); } | ||
3785 | 115 | |||
3786 | 116 | virtual void *AnchorReference(const Mark &mark, void *pNode) { | ||
3787 | 117 | return CheckType<Node>(m_impl.AnchorReference(mark, AsNode(pNode))); | ||
3788 | 118 | } | ||
3789 | 119 | |||
3790 | 120 | private: | ||
3791 | 121 | Impl &m_impl; | ||
3792 | 122 | |||
3793 | 123 | // Static check for pointer to T | ||
3794 | 124 | template <class T, class U> | ||
3795 | 125 | static T *CheckType(U *p) { | ||
3796 | 126 | return p; | ||
3797 | 127 | } | ||
3798 | 128 | |||
3799 | 129 | static Node *AsNode(void *pNode) { return static_cast<Node *>(pNode); } | ||
3800 | 130 | static Sequence *AsSequence(void *pSeq) { | ||
3801 | 131 | return static_cast<Sequence *>(pSeq); | ||
3802 | 132 | } | ||
3803 | 133 | static Map *AsMap(void *pMap) { return static_cast<Map *>(pMap); } | ||
3804 | 134 | }; | ||
3805 | 135 | |||
3806 | 136 | void *BuildGraphOfNextDocument(Parser &parser, | ||
3807 | 137 | GraphBuilderInterface &graphBuilder); | ||
3808 | 138 | |||
3809 | 139 | template <class Impl> | ||
3810 | 140 | typename Impl::Node *BuildGraphOfNextDocument(Parser &parser, Impl &impl) { | ||
3811 | 141 | GraphBuilder<Impl> graphBuilder(impl); | ||
3812 | 142 | return static_cast<typename Impl::Node *>( | ||
3813 | 143 | BuildGraphOfNextDocument(parser, graphBuilder)); | ||
3814 | 144 | } | ||
3815 | 145 | } | ||
3816 | 146 | |||
3817 | 147 | #endif // GRAPHBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3818 | 0 | 148 | ||
3819 | === added file 'dist/yaml-cpp/include/yaml-cpp/dll.h' | |||
3820 | --- dist/yaml-cpp/include/yaml-cpp/dll.h 1970-01-01 00:00:00 +0000 | |||
3821 | +++ dist/yaml-cpp/include/yaml-cpp/dll.h 2016-10-18 07:57:32 +0000 | |||
3822 | @@ -0,0 +1,37 @@ | |||
3823 | 1 | #ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3824 | 2 | #define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3825 | 3 | |||
3826 | 4 | #if defined(_MSC_VER) || \ | ||
3827 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
3828 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
3829 | 7 | #pragma once | ||
3830 | 8 | #endif | ||
3831 | 9 | |||
3832 | 10 | // The following ifdef block is the standard way of creating macros which make | ||
3833 | 11 | // exporting | ||
3834 | 12 | // from a DLL simpler. All files within this DLL are compiled with the | ||
3835 | 13 | // yaml_cpp_EXPORTS | ||
3836 | 14 | // symbol defined on the command line. this symbol should not be defined on any | ||
3837 | 15 | // project | ||
3838 | 16 | // that uses this DLL. This way any other project whose source files include | ||
3839 | 17 | // this file see | ||
3840 | 18 | // YAML_CPP_API functions as being imported from a DLL, whereas this DLL sees | ||
3841 | 19 | // symbols | ||
3842 | 20 | // defined with this macro as being exported. | ||
3843 | 21 | #undef YAML_CPP_API | ||
3844 | 22 | |||
3845 | 23 | #ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined | ||
3846 | 24 | // manually) | ||
3847 | 25 | #ifdef yaml_cpp_EXPORTS // Building YAML-CPP DLL (definition created by CMake | ||
3848 | 26 | // or defined manually) | ||
3849 | 27 | // #pragma message( "Defining YAML_CPP_API for DLL export" ) | ||
3850 | 28 | #define YAML_CPP_API __declspec(dllexport) | ||
3851 | 29 | #else // yaml_cpp_EXPORTS | ||
3852 | 30 | // #pragma message( "Defining YAML_CPP_API for DLL import" ) | ||
3853 | 31 | #define YAML_CPP_API __declspec(dllimport) | ||
3854 | 32 | #endif // yaml_cpp_EXPORTS | ||
3855 | 33 | #else // YAML_CPP_DLL | ||
3856 | 34 | #define YAML_CPP_API | ||
3857 | 35 | #endif // YAML_CPP_DLL | ||
3858 | 36 | |||
3859 | 37 | #endif // DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3860 | 0 | 38 | ||
3861 | === added file 'dist/yaml-cpp/include/yaml-cpp/emitfromevents.h' | |||
3862 | --- dist/yaml-cpp/include/yaml-cpp/emitfromevents.h 1970-01-01 00:00:00 +0000 | |||
3863 | +++ dist/yaml-cpp/include/yaml-cpp/emitfromevents.h 2016-10-18 07:57:32 +0000 | |||
3864 | @@ -0,0 +1,57 @@ | |||
3865 | 1 | #ifndef EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3866 | 2 | #define EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3867 | 3 | |||
3868 | 4 | #if defined(_MSC_VER) || \ | ||
3869 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
3870 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
3871 | 7 | #pragma once | ||
3872 | 8 | #endif | ||
3873 | 9 | |||
3874 | 10 | #include <stack> | ||
3875 | 11 | |||
3876 | 12 | #include "yaml-cpp/anchor.h" | ||
3877 | 13 | #include "yaml-cpp/emitterstyle.h" | ||
3878 | 14 | #include "yaml-cpp/eventhandler.h" | ||
3879 | 15 | |||
3880 | 16 | namespace YAML { | ||
3881 | 17 | struct Mark; | ||
3882 | 18 | } // namespace YAML | ||
3883 | 19 | |||
3884 | 20 | namespace YAML { | ||
3885 | 21 | class Emitter; | ||
3886 | 22 | |||
3887 | 23 | class EmitFromEvents : public EventHandler { | ||
3888 | 24 | public: | ||
3889 | 25 | EmitFromEvents(Emitter& emitter); | ||
3890 | 26 | |||
3891 | 27 | virtual void OnDocumentStart(const Mark& mark); | ||
3892 | 28 | virtual void OnDocumentEnd(); | ||
3893 | 29 | |||
3894 | 30 | virtual void OnNull(const Mark& mark, anchor_t anchor); | ||
3895 | 31 | virtual void OnAlias(const Mark& mark, anchor_t anchor); | ||
3896 | 32 | virtual void OnScalar(const Mark& mark, const std::string& tag, | ||
3897 | 33 | anchor_t anchor, const std::string& value); | ||
3898 | 34 | |||
3899 | 35 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, | ||
3900 | 36 | anchor_t anchor, EmitterStyle::value style); | ||
3901 | 37 | virtual void OnSequenceEnd(); | ||
3902 | 38 | |||
3903 | 39 | virtual void OnMapStart(const Mark& mark, const std::string& tag, | ||
3904 | 40 | anchor_t anchor, EmitterStyle::value style); | ||
3905 | 41 | virtual void OnMapEnd(); | ||
3906 | 42 | |||
3907 | 43 | private: | ||
3908 | 44 | void BeginNode(); | ||
3909 | 45 | void EmitProps(const std::string& tag, anchor_t anchor); | ||
3910 | 46 | |||
3911 | 47 | private: | ||
3912 | 48 | Emitter& m_emitter; | ||
3913 | 49 | |||
3914 | 50 | struct State { | ||
3915 | 51 | enum value { WaitingForSequenceEntry, WaitingForKey, WaitingForValue }; | ||
3916 | 52 | }; | ||
3917 | 53 | std::stack<State::value> m_stateStack; | ||
3918 | 54 | }; | ||
3919 | 55 | } | ||
3920 | 56 | |||
3921 | 57 | #endif // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3922 | 0 | 58 | ||
3923 | === added file 'dist/yaml-cpp/include/yaml-cpp/emitter.h' | |||
3924 | --- dist/yaml-cpp/include/yaml-cpp/emitter.h 1970-01-01 00:00:00 +0000 | |||
3925 | +++ dist/yaml-cpp/include/yaml-cpp/emitter.h 2016-10-18 07:57:32 +0000 | |||
3926 | @@ -0,0 +1,254 @@ | |||
3927 | 1 | #ifndef EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3928 | 2 | #define EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
3929 | 3 | |||
3930 | 4 | #if defined(_MSC_VER) || \ | ||
3931 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
3932 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
3933 | 7 | #pragma once | ||
3934 | 8 | #endif | ||
3935 | 9 | |||
3936 | 10 | #include <cstddef> | ||
3937 | 11 | #include <memory> | ||
3938 | 12 | #include <sstream> | ||
3939 | 13 | #include <string> | ||
3940 | 14 | |||
3941 | 15 | #include "yaml-cpp/binary.h" | ||
3942 | 16 | #include "yaml-cpp/dll.h" | ||
3943 | 17 | #include "yaml-cpp/emitterdef.h" | ||
3944 | 18 | #include "yaml-cpp/emittermanip.h" | ||
3945 | 19 | #include "yaml-cpp/noncopyable.h" | ||
3946 | 20 | #include "yaml-cpp/null.h" | ||
3947 | 21 | #include "yaml-cpp/ostream_wrapper.h" | ||
3948 | 22 | |||
3949 | 23 | namespace YAML { | ||
3950 | 24 | class Binary; | ||
3951 | 25 | struct _Null; | ||
3952 | 26 | } // namespace YAML | ||
3953 | 27 | |||
3954 | 28 | namespace YAML { | ||
3955 | 29 | class EmitterState; | ||
3956 | 30 | |||
3957 | 31 | class YAML_CPP_API Emitter : private noncopyable { | ||
3958 | 32 | public: | ||
3959 | 33 | Emitter(); | ||
3960 | 34 | explicit Emitter(std::ostream& stream); | ||
3961 | 35 | ~Emitter(); | ||
3962 | 36 | |||
3963 | 37 | // output | ||
3964 | 38 | const char* c_str() const; | ||
3965 | 39 | std::size_t size() const; | ||
3966 | 40 | |||
3967 | 41 | // state checking | ||
3968 | 42 | bool good() const; | ||
3969 | 43 | const std::string GetLastError() const; | ||
3970 | 44 | |||
3971 | 45 | // global setters | ||
3972 | 46 | bool SetOutputCharset(EMITTER_MANIP value); | ||
3973 | 47 | bool SetStringFormat(EMITTER_MANIP value); | ||
3974 | 48 | bool SetBoolFormat(EMITTER_MANIP value); | ||
3975 | 49 | bool SetIntBase(EMITTER_MANIP value); | ||
3976 | 50 | bool SetSeqFormat(EMITTER_MANIP value); | ||
3977 | 51 | bool SetMapFormat(EMITTER_MANIP value); | ||
3978 | 52 | bool SetIndent(std::size_t n); | ||
3979 | 53 | bool SetPreCommentIndent(std::size_t n); | ||
3980 | 54 | bool SetPostCommentIndent(std::size_t n); | ||
3981 | 55 | bool SetFloatPrecision(std::size_t n); | ||
3982 | 56 | bool SetDoublePrecision(std::size_t n); | ||
3983 | 57 | |||
3984 | 58 | // local setters | ||
3985 | 59 | Emitter& SetLocalValue(EMITTER_MANIP value); | ||
3986 | 60 | Emitter& SetLocalIndent(const _Indent& indent); | ||
3987 | 61 | Emitter& SetLocalPrecision(const _Precision& precision); | ||
3988 | 62 | |||
3989 | 63 | // overloads of write | ||
3990 | 64 | Emitter& Write(const std::string& str); | ||
3991 | 65 | Emitter& Write(bool b); | ||
3992 | 66 | Emitter& Write(char ch); | ||
3993 | 67 | Emitter& Write(const _Alias& alias); | ||
3994 | 68 | Emitter& Write(const _Anchor& anchor); | ||
3995 | 69 | Emitter& Write(const _Tag& tag); | ||
3996 | 70 | Emitter& Write(const _Comment& comment); | ||
3997 | 71 | Emitter& Write(const _Null& n); | ||
3998 | 72 | Emitter& Write(const Binary& binary); | ||
3999 | 73 | |||
4000 | 74 | template <typename T> | ||
4001 | 75 | Emitter& WriteIntegralType(T value); | ||
4002 | 76 | |||
4003 | 77 | template <typename T> | ||
4004 | 78 | Emitter& WriteStreamable(T value); | ||
4005 | 79 | |||
4006 | 80 | private: | ||
4007 | 81 | template <typename T> | ||
4008 | 82 | void SetStreamablePrecision(std::stringstream&) {} | ||
4009 | 83 | std::size_t GetFloatPrecision() const; | ||
4010 | 84 | std::size_t GetDoublePrecision() const; | ||
4011 | 85 | |||
4012 | 86 | void PrepareIntegralStream(std::stringstream& stream) const; | ||
4013 | 87 | void StartedScalar(); | ||
4014 | 88 | |||
4015 | 89 | private: | ||
4016 | 90 | void EmitBeginDoc(); | ||
4017 | 91 | void EmitEndDoc(); | ||
4018 | 92 | void EmitBeginSeq(); | ||
4019 | 93 | void EmitEndSeq(); | ||
4020 | 94 | void EmitBeginMap(); | ||
4021 | 95 | void EmitEndMap(); | ||
4022 | 96 | void EmitNewline(); | ||
4023 | 97 | void EmitKindTag(); | ||
4024 | 98 | void EmitTag(bool verbatim, const _Tag& tag); | ||
4025 | 99 | |||
4026 | 100 | void PrepareNode(EmitterNodeType::value child); | ||
4027 | 101 | void PrepareTopNode(EmitterNodeType::value child); | ||
4028 | 102 | void FlowSeqPrepareNode(EmitterNodeType::value child); | ||
4029 | 103 | void BlockSeqPrepareNode(EmitterNodeType::value child); | ||
4030 | 104 | |||
4031 | 105 | void FlowMapPrepareNode(EmitterNodeType::value child); | ||
4032 | 106 | |||
4033 | 107 | void FlowMapPrepareLongKey(EmitterNodeType::value child); | ||
4034 | 108 | void FlowMapPrepareLongKeyValue(EmitterNodeType::value child); | ||
4035 | 109 | void FlowMapPrepareSimpleKey(EmitterNodeType::value child); | ||
4036 | 110 | void FlowMapPrepareSimpleKeyValue(EmitterNodeType::value child); | ||
4037 | 111 | |||
4038 | 112 | void BlockMapPrepareNode(EmitterNodeType::value child); | ||
4039 | 113 | |||
4040 | 114 | void BlockMapPrepareLongKey(EmitterNodeType::value child); | ||
4041 | 115 | void BlockMapPrepareLongKeyValue(EmitterNodeType::value child); | ||
4042 | 116 | void BlockMapPrepareSimpleKey(EmitterNodeType::value child); | ||
4043 | 117 | void BlockMapPrepareSimpleKeyValue(EmitterNodeType::value child); | ||
4044 | 118 | |||
4045 | 119 | void SpaceOrIndentTo(bool requireSpace, std::size_t indent); | ||
4046 | 120 | |||
4047 | 121 | const char* ComputeFullBoolName(bool b) const; | ||
4048 | 122 | bool CanEmitNewline() const; | ||
4049 | 123 | |||
4050 | 124 | private: | ||
4051 | 125 | std::auto_ptr<EmitterState> m_pState; | ||
4052 | 126 | ostream_wrapper m_stream; | ||
4053 | 127 | }; | ||
4054 | 128 | |||
4055 | 129 | template <typename T> | ||
4056 | 130 | inline Emitter& Emitter::WriteIntegralType(T value) { | ||
4057 | 131 | if (!good()) | ||
4058 | 132 | return *this; | ||
4059 | 133 | |||
4060 | 134 | PrepareNode(EmitterNodeType::Scalar); | ||
4061 | 135 | |||
4062 | 136 | std::stringstream stream; | ||
4063 | 137 | PrepareIntegralStream(stream); | ||
4064 | 138 | stream << value; | ||
4065 | 139 | m_stream << stream.str(); | ||
4066 | 140 | |||
4067 | 141 | StartedScalar(); | ||
4068 | 142 | |||
4069 | 143 | return *this; | ||
4070 | 144 | } | ||
4071 | 145 | |||
4072 | 146 | template <typename T> | ||
4073 | 147 | inline Emitter& Emitter::WriteStreamable(T value) { | ||
4074 | 148 | if (!good()) | ||
4075 | 149 | return *this; | ||
4076 | 150 | |||
4077 | 151 | PrepareNode(EmitterNodeType::Scalar); | ||
4078 | 152 | |||
4079 | 153 | std::stringstream stream; | ||
4080 | 154 | SetStreamablePrecision<T>(stream); | ||
4081 | 155 | stream << value; | ||
4082 | 156 | m_stream << stream.str(); | ||
4083 | 157 | |||
4084 | 158 | StartedScalar(); | ||
4085 | 159 | |||
4086 | 160 | return *this; | ||
4087 | 161 | } | ||
4088 | 162 | |||
4089 | 163 | template <> | ||
4090 | 164 | inline void Emitter::SetStreamablePrecision<float>(std::stringstream& stream) { | ||
4091 | 165 | stream.precision(GetFloatPrecision()); | ||
4092 | 166 | } | ||
4093 | 167 | |||
4094 | 168 | template <> | ||
4095 | 169 | inline void Emitter::SetStreamablePrecision<double>(std::stringstream& stream) { | ||
4096 | 170 | stream.precision(GetDoublePrecision()); | ||
4097 | 171 | } | ||
4098 | 172 | |||
4099 | 173 | // overloads of insertion | ||
4100 | 174 | inline Emitter& operator<<(Emitter& emitter, const std::string& v) { | ||
4101 | 175 | return emitter.Write(v); | ||
4102 | 176 | } | ||
4103 | 177 | inline Emitter& operator<<(Emitter& emitter, bool v) { | ||
4104 | 178 | return emitter.Write(v); | ||
4105 | 179 | } | ||
4106 | 180 | inline Emitter& operator<<(Emitter& emitter, char v) { | ||
4107 | 181 | return emitter.Write(v); | ||
4108 | 182 | } | ||
4109 | 183 | inline Emitter& operator<<(Emitter& emitter, unsigned char v) { | ||
4110 | 184 | return emitter.Write(static_cast<char>(v)); | ||
4111 | 185 | } | ||
4112 | 186 | inline Emitter& operator<<(Emitter& emitter, const _Alias& v) { | ||
4113 | 187 | return emitter.Write(v); | ||
4114 | 188 | } | ||
4115 | 189 | inline Emitter& operator<<(Emitter& emitter, const _Anchor& v) { | ||
4116 | 190 | return emitter.Write(v); | ||
4117 | 191 | } | ||
4118 | 192 | inline Emitter& operator<<(Emitter& emitter, const _Tag& v) { | ||
4119 | 193 | return emitter.Write(v); | ||
4120 | 194 | } | ||
4121 | 195 | inline Emitter& operator<<(Emitter& emitter, const _Comment& v) { | ||
4122 | 196 | return emitter.Write(v); | ||
4123 | 197 | } | ||
4124 | 198 | inline Emitter& operator<<(Emitter& emitter, const _Null& v) { | ||
4125 | 199 | return emitter.Write(v); | ||
4126 | 200 | } | ||
4127 | 201 | inline Emitter& operator<<(Emitter& emitter, const Binary& b) { | ||
4128 | 202 | return emitter.Write(b); | ||
4129 | 203 | } | ||
4130 | 204 | |||
4131 | 205 | inline Emitter& operator<<(Emitter& emitter, const char* v) { | ||
4132 | 206 | return emitter.Write(std::string(v)); | ||
4133 | 207 | } | ||
4134 | 208 | |||
4135 | 209 | inline Emitter& operator<<(Emitter& emitter, int v) { | ||
4136 | 210 | return emitter.WriteIntegralType(v); | ||
4137 | 211 | } | ||
4138 | 212 | inline Emitter& operator<<(Emitter& emitter, unsigned int v) { | ||
4139 | 213 | return emitter.WriteIntegralType(v); | ||
4140 | 214 | } | ||
4141 | 215 | inline Emitter& operator<<(Emitter& emitter, short v) { | ||
4142 | 216 | return emitter.WriteIntegralType(v); | ||
4143 | 217 | } | ||
4144 | 218 | inline Emitter& operator<<(Emitter& emitter, unsigned short v) { | ||
4145 | 219 | return emitter.WriteIntegralType(v); | ||
4146 | 220 | } | ||
4147 | 221 | inline Emitter& operator<<(Emitter& emitter, long v) { | ||
4148 | 222 | return emitter.WriteIntegralType(v); | ||
4149 | 223 | } | ||
4150 | 224 | inline Emitter& operator<<(Emitter& emitter, unsigned long v) { | ||
4151 | 225 | return emitter.WriteIntegralType(v); | ||
4152 | 226 | } | ||
4153 | 227 | inline Emitter& operator<<(Emitter& emitter, long long v) { | ||
4154 | 228 | return emitter.WriteIntegralType(v); | ||
4155 | 229 | } | ||
4156 | 230 | inline Emitter& operator<<(Emitter& emitter, unsigned long long v) { | ||
4157 | 231 | return emitter.WriteIntegralType(v); | ||
4158 | 232 | } | ||
4159 | 233 | |||
4160 | 234 | inline Emitter& operator<<(Emitter& emitter, float v) { | ||
4161 | 235 | return emitter.WriteStreamable(v); | ||
4162 | 236 | } | ||
4163 | 237 | inline Emitter& operator<<(Emitter& emitter, double v) { | ||
4164 | 238 | return emitter.WriteStreamable(v); | ||
4165 | 239 | } | ||
4166 | 240 | |||
4167 | 241 | inline Emitter& operator<<(Emitter& emitter, EMITTER_MANIP value) { | ||
4168 | 242 | return emitter.SetLocalValue(value); | ||
4169 | 243 | } | ||
4170 | 244 | |||
4171 | 245 | inline Emitter& operator<<(Emitter& emitter, _Indent indent) { | ||
4172 | 246 | return emitter.SetLocalIndent(indent); | ||
4173 | 247 | } | ||
4174 | 248 | |||
4175 | 249 | inline Emitter& operator<<(Emitter& emitter, _Precision precision) { | ||
4176 | 250 | return emitter.SetLocalPrecision(precision); | ||
4177 | 251 | } | ||
4178 | 252 | } | ||
4179 | 253 | |||
4180 | 254 | #endif // EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4181 | 0 | 255 | ||
4182 | === added file 'dist/yaml-cpp/include/yaml-cpp/emitterdef.h' | |||
4183 | --- dist/yaml-cpp/include/yaml-cpp/emitterdef.h 1970-01-01 00:00:00 +0000 | |||
4184 | +++ dist/yaml-cpp/include/yaml-cpp/emitterdef.h 2016-10-18 07:57:32 +0000 | |||
4185 | @@ -0,0 +1,16 @@ | |||
4186 | 1 | #ifndef EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4187 | 2 | #define EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4188 | 3 | |||
4189 | 4 | #if defined(_MSC_VER) || \ | ||
4190 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
4191 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
4192 | 7 | #pragma once | ||
4193 | 8 | #endif | ||
4194 | 9 | |||
4195 | 10 | namespace YAML { | ||
4196 | 11 | struct EmitterNodeType { | ||
4197 | 12 | enum value { NoType, Property, Scalar, FlowSeq, BlockSeq, FlowMap, BlockMap }; | ||
4198 | 13 | }; | ||
4199 | 14 | } | ||
4200 | 15 | |||
4201 | 16 | #endif // EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4202 | 0 | 17 | ||
4203 | === added file 'dist/yaml-cpp/include/yaml-cpp/emittermanip.h' | |||
4204 | --- dist/yaml-cpp/include/yaml-cpp/emittermanip.h 1970-01-01 00:00:00 +0000 | |||
4205 | +++ dist/yaml-cpp/include/yaml-cpp/emittermanip.h 2016-10-18 07:57:32 +0000 | |||
4206 | @@ -0,0 +1,137 @@ | |||
4207 | 1 | #ifndef EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4208 | 2 | #define EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4209 | 3 | |||
4210 | 4 | #if defined(_MSC_VER) || \ | ||
4211 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
4212 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
4213 | 7 | #pragma once | ||
4214 | 8 | #endif | ||
4215 | 9 | |||
4216 | 10 | #include <string> | ||
4217 | 11 | |||
4218 | 12 | namespace YAML { | ||
4219 | 13 | enum EMITTER_MANIP { | ||
4220 | 14 | // general manipulators | ||
4221 | 15 | Auto, | ||
4222 | 16 | TagByKind, | ||
4223 | 17 | Newline, | ||
4224 | 18 | |||
4225 | 19 | // output character set | ||
4226 | 20 | EmitNonAscii, | ||
4227 | 21 | EscapeNonAscii, | ||
4228 | 22 | |||
4229 | 23 | // string manipulators | ||
4230 | 24 | // Auto, // duplicate | ||
4231 | 25 | SingleQuoted, | ||
4232 | 26 | DoubleQuoted, | ||
4233 | 27 | Literal, | ||
4234 | 28 | |||
4235 | 29 | // bool manipulators | ||
4236 | 30 | YesNoBool, // yes, no | ||
4237 | 31 | TrueFalseBool, // true, false | ||
4238 | 32 | OnOffBool, // on, off | ||
4239 | 33 | UpperCase, // TRUE, N | ||
4240 | 34 | LowerCase, // f, yes | ||
4241 | 35 | CamelCase, // No, Off | ||
4242 | 36 | LongBool, // yes, On | ||
4243 | 37 | ShortBool, // y, t | ||
4244 | 38 | |||
4245 | 39 | // int manipulators | ||
4246 | 40 | Dec, | ||
4247 | 41 | Hex, | ||
4248 | 42 | Oct, | ||
4249 | 43 | |||
4250 | 44 | // document manipulators | ||
4251 | 45 | BeginDoc, | ||
4252 | 46 | EndDoc, | ||
4253 | 47 | |||
4254 | 48 | // sequence manipulators | ||
4255 | 49 | BeginSeq, | ||
4256 | 50 | EndSeq, | ||
4257 | 51 | Flow, | ||
4258 | 52 | Block, | ||
4259 | 53 | |||
4260 | 54 | // map manipulators | ||
4261 | 55 | BeginMap, | ||
4262 | 56 | EndMap, | ||
4263 | 57 | Key, | ||
4264 | 58 | Value, | ||
4265 | 59 | // Flow, // duplicate | ||
4266 | 60 | // Block, // duplicate | ||
4267 | 61 | // Auto, // duplicate | ||
4268 | 62 | LongKey | ||
4269 | 63 | }; | ||
4270 | 64 | |||
4271 | 65 | struct _Indent { | ||
4272 | 66 | _Indent(int value_) : value(value_) {} | ||
4273 | 67 | int value; | ||
4274 | 68 | }; | ||
4275 | 69 | |||
4276 | 70 | inline _Indent Indent(int value) { return _Indent(value); } | ||
4277 | 71 | |||
4278 | 72 | struct _Alias { | ||
4279 | 73 | _Alias(const std::string& content_) : content(content_) {} | ||
4280 | 74 | std::string content; | ||
4281 | 75 | }; | ||
4282 | 76 | |||
4283 | 77 | inline _Alias Alias(const std::string content) { return _Alias(content); } | ||
4284 | 78 | |||
4285 | 79 | struct _Anchor { | ||
4286 | 80 | _Anchor(const std::string& content_) : content(content_) {} | ||
4287 | 81 | std::string content; | ||
4288 | 82 | }; | ||
4289 | 83 | |||
4290 | 84 | inline _Anchor Anchor(const std::string content) { return _Anchor(content); } | ||
4291 | 85 | |||
4292 | 86 | struct _Tag { | ||
4293 | 87 | struct Type { | ||
4294 | 88 | enum value { Verbatim, PrimaryHandle, NamedHandle }; | ||
4295 | 89 | }; | ||
4296 | 90 | |||
4297 | 91 | explicit _Tag(const std::string& prefix_, const std::string& content_, | ||
4298 | 92 | Type::value type_) | ||
4299 | 93 | : prefix(prefix_), content(content_), type(type_) {} | ||
4300 | 94 | std::string prefix; | ||
4301 | 95 | std::string content; | ||
4302 | 96 | Type::value type; | ||
4303 | 97 | }; | ||
4304 | 98 | |||
4305 | 99 | inline _Tag VerbatimTag(const std::string content) { | ||
4306 | 100 | return _Tag("", content, _Tag::Type::Verbatim); | ||
4307 | 101 | } | ||
4308 | 102 | |||
4309 | 103 | inline _Tag LocalTag(const std::string content) { | ||
4310 | 104 | return _Tag("", content, _Tag::Type::PrimaryHandle); | ||
4311 | 105 | } | ||
4312 | 106 | |||
4313 | 107 | inline _Tag LocalTag(const std::string& prefix, const std::string content) { | ||
4314 | 108 | return _Tag(prefix, content, _Tag::Type::NamedHandle); | ||
4315 | 109 | } | ||
4316 | 110 | |||
4317 | 111 | inline _Tag SecondaryTag(const std::string content) { | ||
4318 | 112 | return _Tag("", content, _Tag::Type::NamedHandle); | ||
4319 | 113 | } | ||
4320 | 114 | |||
4321 | 115 | struct _Comment { | ||
4322 | 116 | _Comment(const std::string& content_) : content(content_) {} | ||
4323 | 117 | std::string content; | ||
4324 | 118 | }; | ||
4325 | 119 | |||
4326 | 120 | inline _Comment Comment(const std::string content) { return _Comment(content); } | ||
4327 | 121 | |||
4328 | 122 | struct _Precision { | ||
4329 | 123 | _Precision(int floatPrecision_, int doublePrecision_) | ||
4330 | 124 | : floatPrecision(floatPrecision_), doublePrecision(doublePrecision_) {} | ||
4331 | 125 | |||
4332 | 126 | int floatPrecision; | ||
4333 | 127 | int doublePrecision; | ||
4334 | 128 | }; | ||
4335 | 129 | |||
4336 | 130 | inline _Precision FloatPrecision(int n) { return _Precision(n, -1); } | ||
4337 | 131 | |||
4338 | 132 | inline _Precision DoublePrecision(int n) { return _Precision(-1, n); } | ||
4339 | 133 | |||
4340 | 134 | inline _Precision Precision(int n) { return _Precision(n, n); } | ||
4341 | 135 | } | ||
4342 | 136 | |||
4343 | 137 | #endif // EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4344 | 0 | 138 | ||
4345 | === added file 'dist/yaml-cpp/include/yaml-cpp/emitterstyle.h' | |||
4346 | --- dist/yaml-cpp/include/yaml-cpp/emitterstyle.h 1970-01-01 00:00:00 +0000 | |||
4347 | +++ dist/yaml-cpp/include/yaml-cpp/emitterstyle.h 2016-10-18 07:57:32 +0000 | |||
4348 | @@ -0,0 +1,16 @@ | |||
4349 | 1 | #ifndef EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4350 | 2 | #define EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4351 | 3 | |||
4352 | 4 | #if defined(_MSC_VER) || \ | ||
4353 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
4354 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
4355 | 7 | #pragma once | ||
4356 | 8 | #endif | ||
4357 | 9 | |||
4358 | 10 | namespace YAML { | ||
4359 | 11 | struct EmitterStyle { | ||
4360 | 12 | enum value { Default, Block, Flow }; | ||
4361 | 13 | }; | ||
4362 | 14 | } | ||
4363 | 15 | |||
4364 | 16 | #endif // EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4365 | 0 | 17 | ||
4366 | === added file 'dist/yaml-cpp/include/yaml-cpp/eventhandler.h' | |||
4367 | --- dist/yaml-cpp/include/yaml-cpp/eventhandler.h 1970-01-01 00:00:00 +0000 | |||
4368 | +++ dist/yaml-cpp/include/yaml-cpp/eventhandler.h 2016-10-18 07:57:32 +0000 | |||
4369 | @@ -0,0 +1,40 @@ | |||
4370 | 1 | #ifndef EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4371 | 2 | #define EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4372 | 3 | |||
4373 | 4 | #if defined(_MSC_VER) || \ | ||
4374 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
4375 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
4376 | 7 | #pragma once | ||
4377 | 8 | #endif | ||
4378 | 9 | |||
4379 | 10 | #include <string> | ||
4380 | 11 | |||
4381 | 12 | #include "yaml-cpp/anchor.h" | ||
4382 | 13 | #include "yaml-cpp/emitterstyle.h" | ||
4383 | 14 | |||
4384 | 15 | namespace YAML { | ||
4385 | 16 | struct Mark; | ||
4386 | 17 | |||
4387 | 18 | class EventHandler { | ||
4388 | 19 | public: | ||
4389 | 20 | virtual ~EventHandler() {} | ||
4390 | 21 | |||
4391 | 22 | virtual void OnDocumentStart(const Mark& mark) = 0; | ||
4392 | 23 | virtual void OnDocumentEnd() = 0; | ||
4393 | 24 | |||
4394 | 25 | virtual void OnNull(const Mark& mark, anchor_t anchor) = 0; | ||
4395 | 26 | virtual void OnAlias(const Mark& mark, anchor_t anchor) = 0; | ||
4396 | 27 | virtual void OnScalar(const Mark& mark, const std::string& tag, | ||
4397 | 28 | anchor_t anchor, const std::string& value) = 0; | ||
4398 | 29 | |||
4399 | 30 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, | ||
4400 | 31 | anchor_t anchor, EmitterStyle::value style) = 0; | ||
4401 | 32 | virtual void OnSequenceEnd() = 0; | ||
4402 | 33 | |||
4403 | 34 | virtual void OnMapStart(const Mark& mark, const std::string& tag, | ||
4404 | 35 | anchor_t anchor, EmitterStyle::value style) = 0; | ||
4405 | 36 | virtual void OnMapEnd() = 0; | ||
4406 | 37 | }; | ||
4407 | 38 | } | ||
4408 | 39 | |||
4409 | 40 | #endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4410 | 0 | 41 | ||
4411 | === added file 'dist/yaml-cpp/include/yaml-cpp/exceptions.h' | |||
4412 | --- dist/yaml-cpp/include/yaml-cpp/exceptions.h 1970-01-01 00:00:00 +0000 | |||
4413 | +++ dist/yaml-cpp/include/yaml-cpp/exceptions.h 2016-10-18 07:57:32 +0000 | |||
4414 | @@ -0,0 +1,227 @@ | |||
4415 | 1 | #ifndef EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4416 | 2 | #define EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4417 | 3 | |||
4418 | 4 | #if defined(_MSC_VER) || \ | ||
4419 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
4420 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
4421 | 7 | #pragma once | ||
4422 | 8 | #endif | ||
4423 | 9 | |||
4424 | 10 | #include "yaml-cpp/mark.h" | ||
4425 | 11 | #include "yaml-cpp/traits.h" | ||
4426 | 12 | #include <stdexcept> | ||
4427 | 13 | #include <string> | ||
4428 | 14 | #include <sstream> | ||
4429 | 15 | |||
4430 | 16 | namespace YAML { | ||
4431 | 17 | // error messages | ||
4432 | 18 | namespace ErrorMsg { | ||
4433 | 19 | const char* const YAML_DIRECTIVE_ARGS = | ||
4434 | 20 | "YAML directives must have exactly one argument"; | ||
4435 | 21 | const char* const YAML_VERSION = "bad YAML version: "; | ||
4436 | 22 | const char* const YAML_MAJOR_VERSION = "YAML major version too large"; | ||
4437 | 23 | const char* const REPEATED_YAML_DIRECTIVE = "repeated YAML directive"; | ||
4438 | 24 | const char* const TAG_DIRECTIVE_ARGS = | ||
4439 | 25 | "TAG directives must have exactly two arguments"; | ||
4440 | 26 | const char* const REPEATED_TAG_DIRECTIVE = "repeated TAG directive"; | ||
4441 | 27 | const char* const CHAR_IN_TAG_HANDLE = | ||
4442 | 28 | "illegal character found while scanning tag handle"; | ||
4443 | 29 | const char* const TAG_WITH_NO_SUFFIX = "tag handle with no suffix"; | ||
4444 | 30 | const char* const END_OF_VERBATIM_TAG = "end of verbatim tag not found"; | ||
4445 | 31 | const char* const END_OF_MAP = "end of map not found"; | ||
4446 | 32 | const char* const END_OF_MAP_FLOW = "end of map flow not found"; | ||
4447 | 33 | const char* const END_OF_SEQ = "end of sequence not found"; | ||
4448 | 34 | const char* const END_OF_SEQ_FLOW = "end of sequence flow not found"; | ||
4449 | 35 | const char* const MULTIPLE_TAGS = | ||
4450 | 36 | "cannot assign multiple tags to the same node"; | ||
4451 | 37 | const char* const MULTIPLE_ANCHORS = | ||
4452 | 38 | "cannot assign multiple anchors to the same node"; | ||
4453 | 39 | const char* const MULTIPLE_ALIASES = | ||
4454 | 40 | "cannot assign multiple aliases to the same node"; | ||
4455 | 41 | const char* const ALIAS_CONTENT = | ||
4456 | 42 | "aliases can't have any content, *including* tags"; | ||
4457 | 43 | const char* const INVALID_HEX = "bad character found while scanning hex number"; | ||
4458 | 44 | const char* const INVALID_UNICODE = "invalid unicode: "; | ||
4459 | 45 | const char* const INVALID_ESCAPE = "unknown escape character: "; | ||
4460 | 46 | const char* const UNKNOWN_TOKEN = "unknown token"; | ||
4461 | 47 | const char* const DOC_IN_SCALAR = "illegal document indicator in scalar"; | ||
4462 | 48 | const char* const EOF_IN_SCALAR = "illegal EOF in scalar"; | ||
4463 | 49 | const char* const CHAR_IN_SCALAR = "illegal character in scalar"; | ||
4464 | 50 | const char* const TAB_IN_INDENTATION = | ||
4465 | 51 | "illegal tab when looking for indentation"; | ||
4466 | 52 | const char* const FLOW_END = "illegal flow end"; | ||
4467 | 53 | const char* const BLOCK_ENTRY = "illegal block entry"; | ||
4468 | 54 | const char* const MAP_KEY = "illegal map key"; | ||
4469 | 55 | const char* const MAP_VALUE = "illegal map value"; | ||
4470 | 56 | const char* const ALIAS_NOT_FOUND = "alias not found after *"; | ||
4471 | 57 | const char* const ANCHOR_NOT_FOUND = "anchor not found after &"; | ||
4472 | 58 | const char* const CHAR_IN_ALIAS = | ||
4473 | 59 | "illegal character found while scanning alias"; | ||
4474 | 60 | const char* const CHAR_IN_ANCHOR = | ||
4475 | 61 | "illegal character found while scanning anchor"; | ||
4476 | 62 | const char* const ZERO_INDENT_IN_BLOCK = | ||
4477 | 63 | "cannot set zero indentation for a block scalar"; | ||
4478 | 64 | const char* const CHAR_IN_BLOCK = "unexpected character in block scalar"; | ||
4479 | 65 | const char* const AMBIGUOUS_ANCHOR = | ||
4480 | 66 | "cannot assign the same alias to multiple nodes"; | ||
4481 | 67 | const char* const UNKNOWN_ANCHOR = "the referenced anchor is not defined"; | ||
4482 | 68 | |||
4483 | 69 | const char* const INVALID_NODE = | ||
4484 | 70 | "invalid node; this may result from using a map iterator as a sequence " | ||
4485 | 71 | "iterator, or vice-versa"; | ||
4486 | 72 | const char* const INVALID_SCALAR = "invalid scalar"; | ||
4487 | 73 | const char* const KEY_NOT_FOUND = "key not found"; | ||
4488 | 74 | const char* const BAD_CONVERSION = "bad conversion"; | ||
4489 | 75 | const char* const BAD_DEREFERENCE = "bad dereference"; | ||
4490 | 76 | const char* const BAD_SUBSCRIPT = "operator[] call on a scalar"; | ||
4491 | 77 | const char* const BAD_PUSHBACK = "appending to a non-sequence"; | ||
4492 | 78 | const char* const BAD_INSERT = "inserting in a non-convertible-to-map"; | ||
4493 | 79 | |||
4494 | 80 | const char* const UNMATCHED_GROUP_TAG = "unmatched group tag"; | ||
4495 | 81 | const char* const UNEXPECTED_END_SEQ = "unexpected end sequence token"; | ||
4496 | 82 | const char* const UNEXPECTED_END_MAP = "unexpected end map token"; | ||
4497 | 83 | const char* const SINGLE_QUOTED_CHAR = | ||
4498 | 84 | "invalid character in single-quoted string"; | ||
4499 | 85 | const char* const INVALID_ANCHOR = "invalid anchor"; | ||
4500 | 86 | const char* const INVALID_ALIAS = "invalid alias"; | ||
4501 | 87 | const char* const INVALID_TAG = "invalid tag"; | ||
4502 | 88 | const char* const BAD_FILE = "bad file"; | ||
4503 | 89 | |||
4504 | 90 | template <typename T> | ||
4505 | 91 | inline const std::string KEY_NOT_FOUND_WITH_KEY( | ||
4506 | 92 | const T&, typename disable_if<is_numeric<T> >::type* = 0) { | ||
4507 | 93 | return KEY_NOT_FOUND; | ||
4508 | 94 | } | ||
4509 | 95 | |||
4510 | 96 | inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) { | ||
4511 | 97 | std::stringstream stream; | ||
4512 | 98 | stream << KEY_NOT_FOUND << ": " << key; | ||
4513 | 99 | return stream.str(); | ||
4514 | 100 | } | ||
4515 | 101 | |||
4516 | 102 | template <typename T> | ||
4517 | 103 | inline const std::string KEY_NOT_FOUND_WITH_KEY( | ||
4518 | 104 | const T& key, typename enable_if<is_numeric<T> >::type* = 0) { | ||
4519 | 105 | std::stringstream stream; | ||
4520 | 106 | stream << KEY_NOT_FOUND << ": " << key; | ||
4521 | 107 | return stream.str(); | ||
4522 | 108 | } | ||
4523 | 109 | } | ||
4524 | 110 | |||
4525 | 111 | class Exception : public std::runtime_error { | ||
4526 | 112 | public: | ||
4527 | 113 | Exception(const Mark& mark_, const std::string& msg_) | ||
4528 | 114 | : std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {} | ||
4529 | 115 | virtual ~Exception() throw() {} | ||
4530 | 116 | |||
4531 | 117 | Mark mark; | ||
4532 | 118 | std::string msg; | ||
4533 | 119 | |||
4534 | 120 | private: | ||
4535 | 121 | static const std::string build_what(const Mark& mark, | ||
4536 | 122 | const std::string& msg) { | ||
4537 | 123 | std::stringstream output; | ||
4538 | 124 | output << "yaml-cpp: error at line " << mark.line + 1 << ", column " | ||
4539 | 125 | << mark.column + 1 << ": " << msg; | ||
4540 | 126 | return output.str(); | ||
4541 | 127 | } | ||
4542 | 128 | }; | ||
4543 | 129 | |||
4544 | 130 | class ParserException : public Exception { | ||
4545 | 131 | public: | ||
4546 | 132 | ParserException(const Mark& mark_, const std::string& msg_) | ||
4547 | 133 | : Exception(mark_, msg_) {} | ||
4548 | 134 | }; | ||
4549 | 135 | |||
4550 | 136 | class RepresentationException : public Exception { | ||
4551 | 137 | public: | ||
4552 | 138 | RepresentationException(const Mark& mark_, const std::string& msg_) | ||
4553 | 139 | : Exception(mark_, msg_) {} | ||
4554 | 140 | }; | ||
4555 | 141 | |||
4556 | 142 | // representation exceptions | ||
4557 | 143 | class InvalidScalar : public RepresentationException { | ||
4558 | 144 | public: | ||
4559 | 145 | InvalidScalar(const Mark& mark_) | ||
4560 | 146 | : RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {} | ||
4561 | 147 | }; | ||
4562 | 148 | |||
4563 | 149 | class KeyNotFound : public RepresentationException { | ||
4564 | 150 | public: | ||
4565 | 151 | template <typename T> | ||
4566 | 152 | KeyNotFound(const Mark& mark_, const T& key_) | ||
4567 | 153 | : RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) { | ||
4568 | 154 | } | ||
4569 | 155 | }; | ||
4570 | 156 | |||
4571 | 157 | template <typename T> | ||
4572 | 158 | class TypedKeyNotFound : public KeyNotFound { | ||
4573 | 159 | public: | ||
4574 | 160 | TypedKeyNotFound(const Mark& mark_, const T& key_) | ||
4575 | 161 | : KeyNotFound(mark_, key_), key(key_) {} | ||
4576 | 162 | virtual ~TypedKeyNotFound() throw() {} | ||
4577 | 163 | |||
4578 | 164 | T key; | ||
4579 | 165 | }; | ||
4580 | 166 | |||
4581 | 167 | template <typename T> | ||
4582 | 168 | inline TypedKeyNotFound<T> MakeTypedKeyNotFound(const Mark& mark, | ||
4583 | 169 | const T& key) { | ||
4584 | 170 | return TypedKeyNotFound<T>(mark, key); | ||
4585 | 171 | } | ||
4586 | 172 | |||
4587 | 173 | class InvalidNode : public RepresentationException { | ||
4588 | 174 | public: | ||
4589 | 175 | InvalidNode() | ||
4590 | 176 | : RepresentationException(Mark::null_mark(), ErrorMsg::INVALID_NODE) {} | ||
4591 | 177 | }; | ||
4592 | 178 | |||
4593 | 179 | class BadConversion : public RepresentationException { | ||
4594 | 180 | public: | ||
4595 | 181 | BadConversion() | ||
4596 | 182 | : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_CONVERSION) {} | ||
4597 | 183 | }; | ||
4598 | 184 | |||
4599 | 185 | template <typename T> | ||
4600 | 186 | class TypedBadConversion : public BadConversion { | ||
4601 | 187 | public: | ||
4602 | 188 | TypedBadConversion() : BadConversion() {} | ||
4603 | 189 | }; | ||
4604 | 190 | |||
4605 | 191 | class BadDereference : public RepresentationException { | ||
4606 | 192 | public: | ||
4607 | 193 | BadDereference() | ||
4608 | 194 | : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_DEREFERENCE) {} | ||
4609 | 195 | }; | ||
4610 | 196 | |||
4611 | 197 | class BadSubscript : public RepresentationException { | ||
4612 | 198 | public: | ||
4613 | 199 | BadSubscript() | ||
4614 | 200 | : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_SUBSCRIPT) {} | ||
4615 | 201 | }; | ||
4616 | 202 | |||
4617 | 203 | class BadPushback : public RepresentationException { | ||
4618 | 204 | public: | ||
4619 | 205 | BadPushback() | ||
4620 | 206 | : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_PUSHBACK) {} | ||
4621 | 207 | }; | ||
4622 | 208 | |||
4623 | 209 | class BadInsert : public RepresentationException { | ||
4624 | 210 | public: | ||
4625 | 211 | BadInsert() | ||
4626 | 212 | : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_INSERT) {} | ||
4627 | 213 | }; | ||
4628 | 214 | |||
4629 | 215 | class EmitterException : public Exception { | ||
4630 | 216 | public: | ||
4631 | 217 | EmitterException(const std::string& msg_) | ||
4632 | 218 | : Exception(Mark::null_mark(), msg_) {} | ||
4633 | 219 | }; | ||
4634 | 220 | |||
4635 | 221 | class BadFile : public Exception { | ||
4636 | 222 | public: | ||
4637 | 223 | BadFile() : Exception(Mark::null_mark(), ErrorMsg::BAD_FILE) {} | ||
4638 | 224 | }; | ||
4639 | 225 | } | ||
4640 | 226 | |||
4641 | 227 | #endif // EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4642 | 0 | 228 | ||
4643 | === added file 'dist/yaml-cpp/include/yaml-cpp/mark.h' | |||
4644 | --- dist/yaml-cpp/include/yaml-cpp/mark.h 1970-01-01 00:00:00 +0000 | |||
4645 | +++ dist/yaml-cpp/include/yaml-cpp/mark.h 2016-10-18 07:57:32 +0000 | |||
4646 | @@ -0,0 +1,27 @@ | |||
4647 | 1 | #ifndef MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4648 | 2 | #define MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4649 | 3 | |||
4650 | 4 | #if defined(_MSC_VER) || \ | ||
4651 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
4652 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
4653 | 7 | #pragma once | ||
4654 | 8 | #endif | ||
4655 | 9 | |||
4656 | 10 | #include "yaml-cpp/dll.h" | ||
4657 | 11 | |||
4658 | 12 | namespace YAML { | ||
4659 | 13 | struct YAML_CPP_API Mark { | ||
4660 | 14 | Mark() : pos(0), line(0), column(0) {} | ||
4661 | 15 | |||
4662 | 16 | static const Mark null_mark() { return Mark(-1, -1, -1); } | ||
4663 | 17 | |||
4664 | 18 | int pos; | ||
4665 | 19 | int line, column; | ||
4666 | 20 | |||
4667 | 21 | private: | ||
4668 | 22 | Mark(int pos_, int line_, int column_) | ||
4669 | 23 | : pos(pos_), line(line_), column(column_) {} | ||
4670 | 24 | }; | ||
4671 | 25 | } | ||
4672 | 26 | |||
4673 | 27 | #endif // MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4674 | 0 | 28 | ||
4675 | === added directory 'dist/yaml-cpp/include/yaml-cpp/node' | |||
4676 | === added file 'dist/yaml-cpp/include/yaml-cpp/node/convert.h' | |||
4677 | --- dist/yaml-cpp/include/yaml-cpp/node/convert.h 1970-01-01 00:00:00 +0000 | |||
4678 | +++ dist/yaml-cpp/include/yaml-cpp/node/convert.h 2016-10-18 07:57:32 +0000 | |||
4679 | @@ -0,0 +1,286 @@ | |||
4680 | 1 | #ifndef NODE_CONVERT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4681 | 2 | #define NODE_CONVERT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4682 | 3 | |||
4683 | 4 | #if defined(_MSC_VER) || \ | ||
4684 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
4685 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
4686 | 7 | #pragma once | ||
4687 | 8 | #endif | ||
4688 | 9 | |||
4689 | 10 | #include <limits> | ||
4690 | 11 | #include <list> | ||
4691 | 12 | #include <map> | ||
4692 | 13 | #include <sstream> | ||
4693 | 14 | #include <vector> | ||
4694 | 15 | |||
4695 | 16 | #include "yaml-cpp/binary.h" | ||
4696 | 17 | #include "yaml-cpp/node/impl.h" | ||
4697 | 18 | #include "yaml-cpp/node/iterator.h" | ||
4698 | 19 | #include "yaml-cpp/node/node.h" | ||
4699 | 20 | #include "yaml-cpp/node/type.h" | ||
4700 | 21 | #include "yaml-cpp/null.h" | ||
4701 | 22 | |||
4702 | 23 | namespace YAML { | ||
4703 | 24 | class Binary; | ||
4704 | 25 | struct _Null; | ||
4705 | 26 | template <typename T> | ||
4706 | 27 | struct convert; | ||
4707 | 28 | } // namespace YAML | ||
4708 | 29 | |||
4709 | 30 | namespace YAML { | ||
4710 | 31 | namespace conversion { | ||
4711 | 32 | inline bool IsInfinity(const std::string& input) { | ||
4712 | 33 | return input == ".inf" || input == ".Inf" || input == ".INF" || | ||
4713 | 34 | input == "+.inf" || input == "+.Inf" || input == "+.INF"; | ||
4714 | 35 | } | ||
4715 | 36 | |||
4716 | 37 | inline bool IsNegativeInfinity(const std::string& input) { | ||
4717 | 38 | return input == "-.inf" || input == "-.Inf" || input == "-.INF"; | ||
4718 | 39 | } | ||
4719 | 40 | |||
4720 | 41 | inline bool IsNaN(const std::string& input) { | ||
4721 | 42 | return input == ".nan" || input == ".NaN" || input == ".NAN"; | ||
4722 | 43 | } | ||
4723 | 44 | } | ||
4724 | 45 | |||
4725 | 46 | // std::string | ||
4726 | 47 | template <> | ||
4727 | 48 | struct convert<std::string> { | ||
4728 | 49 | static Node encode(const std::string& rhs) { return Node(rhs); } | ||
4729 | 50 | |||
4730 | 51 | static bool decode(const Node& node, std::string& rhs) { | ||
4731 | 52 | if (!node.IsScalar()) | ||
4732 | 53 | return false; | ||
4733 | 54 | rhs = node.Scalar(); | ||
4734 | 55 | return true; | ||
4735 | 56 | } | ||
4736 | 57 | }; | ||
4737 | 58 | |||
4738 | 59 | // C-strings can only be encoded | ||
4739 | 60 | template <> | ||
4740 | 61 | struct convert<const char*> { | ||
4741 | 62 | static Node encode(const char*& rhs) { return Node(rhs); } | ||
4742 | 63 | }; | ||
4743 | 64 | |||
4744 | 65 | template <std::size_t N> | ||
4745 | 66 | struct convert<const char[N]> { | ||
4746 | 67 | static Node encode(const char(&rhs)[N]) { return Node(rhs); } | ||
4747 | 68 | }; | ||
4748 | 69 | |||
4749 | 70 | template <> | ||
4750 | 71 | struct convert<_Null> { | ||
4751 | 72 | static Node encode(const _Null& /* rhs */) { return Node(); } | ||
4752 | 73 | |||
4753 | 74 | static bool decode(const Node& node, _Null& /* rhs */) { | ||
4754 | 75 | return node.IsNull(); | ||
4755 | 76 | } | ||
4756 | 77 | }; | ||
4757 | 78 | |||
4758 | 79 | #define YAML_DEFINE_CONVERT_STREAMABLE(type, negative_op) \ | ||
4759 | 80 | template <> \ | ||
4760 | 81 | struct convert<type> { \ | ||
4761 | 82 | static Node encode(const type& rhs) { \ | ||
4762 | 83 | std::stringstream stream; \ | ||
4763 | 84 | stream.precision(std::numeric_limits<type>::digits10 + 1); \ | ||
4764 | 85 | stream << rhs; \ | ||
4765 | 86 | return Node(stream.str()); \ | ||
4766 | 87 | } \ | ||
4767 | 88 | \ | ||
4768 | 89 | static bool decode(const Node& node, type& rhs) { \ | ||
4769 | 90 | if (node.Type() != NodeType::Scalar) \ | ||
4770 | 91 | return false; \ | ||
4771 | 92 | const std::string& input = node.Scalar(); \ | ||
4772 | 93 | std::stringstream stream(input); \ | ||
4773 | 94 | stream.unsetf(std::ios::dec); \ | ||
4774 | 95 | if ((stream >> std::noskipws >> rhs) && (stream >> std::ws).eof()) \ | ||
4775 | 96 | return true; \ | ||
4776 | 97 | if (std::numeric_limits<type>::has_infinity) { \ | ||
4777 | 98 | if (conversion::IsInfinity(input)) { \ | ||
4778 | 99 | rhs = std::numeric_limits<type>::infinity(); \ | ||
4779 | 100 | return true; \ | ||
4780 | 101 | } else if (conversion::IsNegativeInfinity(input)) { \ | ||
4781 | 102 | rhs = negative_op std::numeric_limits<type>::infinity(); \ | ||
4782 | 103 | return true; \ | ||
4783 | 104 | } \ | ||
4784 | 105 | } \ | ||
4785 | 106 | \ | ||
4786 | 107 | if (std::numeric_limits<type>::has_quiet_NaN && \ | ||
4787 | 108 | conversion::IsNaN(input)) { \ | ||
4788 | 109 | rhs = std::numeric_limits<type>::quiet_NaN(); \ | ||
4789 | 110 | return true; \ | ||
4790 | 111 | } \ | ||
4791 | 112 | \ | ||
4792 | 113 | return false; \ | ||
4793 | 114 | } \ | ||
4794 | 115 | } | ||
4795 | 116 | |||
4796 | 117 | #define YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(type) \ | ||
4797 | 118 | YAML_DEFINE_CONVERT_STREAMABLE(type, -) | ||
4798 | 119 | |||
4799 | 120 | #define YAML_DEFINE_CONVERT_STREAMABLE_UNSIGNED(type) \ | ||
4800 | 121 | YAML_DEFINE_CONVERT_STREAMABLE(type, +) | ||
4801 | 122 | |||
4802 | 123 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(int); | ||
4803 | 124 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(short); | ||
4804 | 125 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(long); | ||
4805 | 126 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(long long); | ||
4806 | 127 | YAML_DEFINE_CONVERT_STREAMABLE_UNSIGNED(unsigned); | ||
4807 | 128 | YAML_DEFINE_CONVERT_STREAMABLE_UNSIGNED(unsigned short); | ||
4808 | 129 | YAML_DEFINE_CONVERT_STREAMABLE_UNSIGNED(unsigned long); | ||
4809 | 130 | YAML_DEFINE_CONVERT_STREAMABLE_UNSIGNED(unsigned long long); | ||
4810 | 131 | |||
4811 | 132 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(char); | ||
4812 | 133 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(signed char); | ||
4813 | 134 | YAML_DEFINE_CONVERT_STREAMABLE_UNSIGNED(unsigned char); | ||
4814 | 135 | |||
4815 | 136 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(float); | ||
4816 | 137 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(double); | ||
4817 | 138 | YAML_DEFINE_CONVERT_STREAMABLE_SIGNED(long double); | ||
4818 | 139 | |||
4819 | 140 | #undef YAML_DEFINE_CONVERT_STREAMABLE_SIGNED | ||
4820 | 141 | #undef YAML_DEFINE_CONVERT_STREAMABLE_UNSIGNED | ||
4821 | 142 | #undef YAML_DEFINE_CONVERT_STREAMABLE | ||
4822 | 143 | |||
4823 | 144 | // bool | ||
4824 | 145 | template <> | ||
4825 | 146 | struct convert<bool> { | ||
4826 | 147 | static Node encode(bool rhs) { return rhs ? Node("true") : Node("false"); } | ||
4827 | 148 | |||
4828 | 149 | YAML_CPP_API static bool decode(const Node& node, bool& rhs); | ||
4829 | 150 | }; | ||
4830 | 151 | |||
4831 | 152 | // std::map | ||
4832 | 153 | template <typename K, typename V> | ||
4833 | 154 | struct convert<std::map<K, V> > { | ||
4834 | 155 | static Node encode(const std::map<K, V>& rhs) { | ||
4835 | 156 | Node node(NodeType::Map); | ||
4836 | 157 | for (typename std::map<K, V>::const_iterator it = rhs.begin(); | ||
4837 | 158 | it != rhs.end(); ++it) | ||
4838 | 159 | node.force_insert(it->first, it->second); | ||
4839 | 160 | return node; | ||
4840 | 161 | } | ||
4841 | 162 | |||
4842 | 163 | static bool decode(const Node& node, std::map<K, V>& rhs) { | ||
4843 | 164 | if (!node.IsMap()) | ||
4844 | 165 | return false; | ||
4845 | 166 | |||
4846 | 167 | rhs.clear(); | ||
4847 | 168 | for (const_iterator it = node.begin(); it != node.end(); ++it) | ||
4848 | 169 | #if defined(__GNUC__) && __GNUC__ < 4 | ||
4849 | 170 | // workaround for GCC 3: | ||
4850 | 171 | rhs[it->first.template as<K>()] = it->second.template as<V>(); | ||
4851 | 172 | #else | ||
4852 | 173 | rhs[it->first.as<K>()] = it->second.as<V>(); | ||
4853 | 174 | #endif | ||
4854 | 175 | return true; | ||
4855 | 176 | } | ||
4856 | 177 | }; | ||
4857 | 178 | |||
4858 | 179 | // std::vector | ||
4859 | 180 | template <typename T> | ||
4860 | 181 | struct convert<std::vector<T> > { | ||
4861 | 182 | static Node encode(const std::vector<T>& rhs) { | ||
4862 | 183 | Node node(NodeType::Sequence); | ||
4863 | 184 | for (typename std::vector<T>::const_iterator it = rhs.begin(); | ||
4864 | 185 | it != rhs.end(); ++it) | ||
4865 | 186 | node.push_back(*it); | ||
4866 | 187 | return node; | ||
4867 | 188 | } | ||
4868 | 189 | |||
4869 | 190 | static bool decode(const Node& node, std::vector<T>& rhs) { | ||
4870 | 191 | if (!node.IsSequence()) | ||
4871 | 192 | return false; | ||
4872 | 193 | |||
4873 | 194 | rhs.clear(); | ||
4874 | 195 | for (const_iterator it = node.begin(); it != node.end(); ++it) | ||
4875 | 196 | #if defined(__GNUC__) && __GNUC__ < 4 | ||
4876 | 197 | // workaround for GCC 3: | ||
4877 | 198 | rhs.push_back(it->template as<T>()); | ||
4878 | 199 | #else | ||
4879 | 200 | rhs.push_back(it->as<T>()); | ||
4880 | 201 | #endif | ||
4881 | 202 | return true; | ||
4882 | 203 | } | ||
4883 | 204 | }; | ||
4884 | 205 | |||
4885 | 206 | // std::list | ||
4886 | 207 | template <typename T> | ||
4887 | 208 | struct convert<std::list<T> > { | ||
4888 | 209 | static Node encode(const std::list<T>& rhs) { | ||
4889 | 210 | Node node(NodeType::Sequence); | ||
4890 | 211 | for (typename std::list<T>::const_iterator it = rhs.begin(); | ||
4891 | 212 | it != rhs.end(); ++it) | ||
4892 | 213 | node.push_back(*it); | ||
4893 | 214 | return node; | ||
4894 | 215 | } | ||
4895 | 216 | |||
4896 | 217 | static bool decode(const Node& node, std::list<T>& rhs) { | ||
4897 | 218 | if (!node.IsSequence()) | ||
4898 | 219 | return false; | ||
4899 | 220 | |||
4900 | 221 | rhs.clear(); | ||
4901 | 222 | for (const_iterator it = node.begin(); it != node.end(); ++it) | ||
4902 | 223 | #if defined(__GNUC__) && __GNUC__ < 4 | ||
4903 | 224 | // workaround for GCC 3: | ||
4904 | 225 | rhs.push_back(it->template as<T>()); | ||
4905 | 226 | #else | ||
4906 | 227 | rhs.push_back(it->as<T>()); | ||
4907 | 228 | #endif | ||
4908 | 229 | return true; | ||
4909 | 230 | } | ||
4910 | 231 | }; | ||
4911 | 232 | |||
4912 | 233 | // std::pair | ||
4913 | 234 | template <typename T, typename U> | ||
4914 | 235 | struct convert<std::pair<T, U> > { | ||
4915 | 236 | static Node encode(const std::pair<T, U>& rhs) { | ||
4916 | 237 | Node node(NodeType::Sequence); | ||
4917 | 238 | node.push_back(rhs.first); | ||
4918 | 239 | node.push_back(rhs.second); | ||
4919 | 240 | return node; | ||
4920 | 241 | } | ||
4921 | 242 | |||
4922 | 243 | static bool decode(const Node& node, std::pair<T, U>& rhs) { | ||
4923 | 244 | if (!node.IsSequence()) | ||
4924 | 245 | return false; | ||
4925 | 246 | if (node.size() != 2) | ||
4926 | 247 | return false; | ||
4927 | 248 | |||
4928 | 249 | #if defined(__GNUC__) && __GNUC__ < 4 | ||
4929 | 250 | // workaround for GCC 3: | ||
4930 | 251 | rhs.first = node[0].template as<T>(); | ||
4931 | 252 | #else | ||
4932 | 253 | rhs.first = node[0].as<T>(); | ||
4933 | 254 | #endif | ||
4934 | 255 | #if defined(__GNUC__) && __GNUC__ < 4 | ||
4935 | 256 | // workaround for GCC 3: | ||
4936 | 257 | rhs.second = node[1].template as<U>(); | ||
4937 | 258 | #else | ||
4938 | 259 | rhs.second = node[1].as<U>(); | ||
4939 | 260 | #endif | ||
4940 | 261 | return true; | ||
4941 | 262 | } | ||
4942 | 263 | }; | ||
4943 | 264 | |||
4944 | 265 | // binary | ||
4945 | 266 | template <> | ||
4946 | 267 | struct convert<Binary> { | ||
4947 | 268 | static Node encode(const Binary& rhs) { | ||
4948 | 269 | return Node(EncodeBase64(rhs.data(), rhs.size())); | ||
4949 | 270 | } | ||
4950 | 271 | |||
4951 | 272 | static bool decode(const Node& node, Binary& rhs) { | ||
4952 | 273 | if (!node.IsScalar()) | ||
4953 | 274 | return false; | ||
4954 | 275 | |||
4955 | 276 | std::vector<unsigned char> data = DecodeBase64(node.Scalar()); | ||
4956 | 277 | if (data.empty() && !node.Scalar().empty()) | ||
4957 | 278 | return false; | ||
4958 | 279 | |||
4959 | 280 | rhs.swap(data); | ||
4960 | 281 | return true; | ||
4961 | 282 | } | ||
4962 | 283 | }; | ||
4963 | 284 | } | ||
4964 | 285 | |||
4965 | 286 | #endif // NODE_CONVERT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4966 | 0 | 287 | ||
4967 | === added directory 'dist/yaml-cpp/include/yaml-cpp/node/detail' | |||
4968 | === added file 'dist/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h' | |||
4969 | --- dist/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h 1970-01-01 00:00:00 +0000 | |||
4970 | +++ dist/yaml-cpp/include/yaml-cpp/node/detail/bool_type.h 2016-10-18 07:57:32 +0000 | |||
4971 | @@ -0,0 +1,26 @@ | |||
4972 | 1 | #ifndef NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4973 | 2 | #define NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4974 | 3 | |||
4975 | 4 | #if defined(_MSC_VER) || \ | ||
4976 | 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
4977 | 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
4978 | 7 | #pragma once | ||
4979 | 8 | #endif | ||
4980 | 9 | |||
4981 | 10 | namespace YAML { | ||
4982 | 11 | namespace detail { | ||
4983 | 12 | struct unspecified_bool { | ||
4984 | 13 | struct NOT_ALLOWED; | ||
4985 | 14 | static void true_value(NOT_ALLOWED*) {} | ||
4986 | 15 | }; | ||
4987 | 16 | typedef void (*unspecified_bool_type)(unspecified_bool::NOT_ALLOWED*); | ||
4988 | 17 | } | ||
4989 | 18 | } | ||
4990 | 19 | |||
4991 | 20 | #define YAML_CPP_OPERATOR_BOOL() \ | ||
4992 | 21 | operator YAML::detail::unspecified_bool_type() const { \ | ||
4993 | 22 | return this->operator!() ? 0 \ | ||
4994 | 23 | : &YAML::detail::unspecified_bool::true_value; \ | ||
4995 | 24 | } | ||
4996 | 25 | |||
4997 | 26 | #endif // NODE_DETAIL_BOOL_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
4998 | 0 | 27 | ||
4999 | === added file 'dist/yaml-cpp/include/yaml-cpp/node/detail/impl.h' | |||
5000 | --- dist/yaml-cpp/include/yaml-cpp/node/detail/impl.h 1970-01-01 00:00:00 +0000 |
The diff has been truncated for viewing.
PASSED: Continuous integration, rev:165 /jenkins. ubuntu. com/ubuntu- sdk/job/ qtcreator- ide-ci- amd64/355/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/7110/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ qtcreator- ide-ci- amd64/355/ rebuild
https:/