1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ndkports 18 19 import java.io.File 20 21 object : MesonPort() { 22 override val name = "jsoncpp" 23 override val version = "1.9.1" 24 override val url = 25 "https://github.com/open-source-parsers/jsoncpp/archive/$version.tar.gz" 26 27 override val license = License( 28 "The JsonCpp License", 29 "https://github.com/open-source-parsers/jsoncpp/blob/master/LICENSE" 30 ) 31 32 override val modules = listOf( 33 Module("jsoncpp") 34 ) 35 fetchSourcenull36 override fun fetchSource( 37 sourceDirectory: File, 38 workingDirectory: File 39 ): Result<Unit, String> = 40 super.fetchSource(sourceDirectory, workingDirectory).onSuccess { 41 // jsoncpp has a "version" file on the include path that conflicts 42 // with https://en.cppreference.com/w/cpp/header/version. Remove it 43 // so we can build. 44 sourceDirectory.resolve("version").delete() 45 } 46 }