Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
twcclegg committed Jan 15, 2021
1 parent 1cc4555 commit 6854062
Show file tree
Hide file tree
Showing 34 changed files with 1,297 additions and 429 deletions.
54 changes: 54 additions & 0 deletions csharp/BuildTools/AbstractPhonePrefixDataIOHandler.cs
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) {
}
}
}
12 changes: 12 additions & 0 deletions csharp/BuildTools/BuildTools.csproj
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>
44 changes: 44 additions & 0 deletions csharp/BuildTools/EntryPoint.cs
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();
}
}
}
Loading

0 comments on commit 6854062

Please sign in to comment.