-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,297 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright (C) 2012 The Libphonenumber Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
/* Abstracts the way GeneratePhonePrefixDataEntryPoint creates files and writes | ||
* the phone prefix data to them. | ||
*/ | ||
|
||
using System; | ||
|
||
public abstract class AbstractPhonePrefixDataIOHandler { | ||
/** | ||
* Adds the provided file to a global output that can be for example a JAR. | ||
* | ||
* @throws IOException | ||
*/ | ||
internal abstract void addFileToOutput(File file); | ||
|
||
/** | ||
* Creates a new file from the provided path. | ||
*/ | ||
internal abstract File createFile(string path); | ||
|
||
/** | ||
* Releases the resources used by the underlying implementation if any. | ||
*/ | ||
internal abstract void close(); | ||
|
||
/** | ||
* Closes the provided file and logs any potential IOException. | ||
*/ | ||
internal void closeFile(Closeable closeable) { | ||
if (closeable == null) { | ||
return; | ||
} | ||
try { | ||
closeable.close(); | ||
} catch (Exception e) { | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net5.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\PhoneNumbers\PhoneNumbers.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace BuildTools | ||
{ | ||
class EntryPoint | ||
{ | ||
static async Task Main(string[] args) | ||
{ | ||
await Task.WhenAll(new List<Task> | ||
{ | ||
MetaDataJsonFromXml.Build(), | ||
MetadataProtoFromXml.Build(), | ||
PhonePrefixData.Generate(), | ||
TimeZonesMapData.Generate() | ||
}); | ||
} | ||
} | ||
|
||
internal class TimeZonesMapData | ||
{ | ||
public static Task Generate() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
internal class MetadataProtoFromXml | ||
{ | ||
public static Task Build() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
internal class MetaDataJsonFromXml | ||
{ | ||
public static Task Build() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
Oops, something went wrong.