o
    nc                     @  sH   d dl mZ d dlmZ d dlZdZdZdZdZdZ	G d	d
 d
eZ
dS )    )annotations)
SampleImplNa  using System;

public class {class_name} {{
    const String PROJECT_NAME = "{project_name}";

    static int Main(String[] args) {{
      if (args.Length > 0) {{
          System.Console.WriteLine(String.Format("{project_name} takes no arguments.."));
          return 1;
      }}
      Console.WriteLine(String.Format("This is project {{0}}.", PROJECT_NAME));
      return 0;
    }}
}}

zproject('{project_name}', 'cs',
  version : '{version}',
  default_options : ['warning_level=3'])

exe = executable('{exe_name}', '{source_name}',
  install : true)

test('basic', exe)
z
public class {class_name} {{
    private const int number = 6;

    public int get_number() {{
      return number;
    }}
}}

a_  using System;

public class {class_test} {{
    static int Main(String[] args) {{
      if (args.Length > 0) {{
          System.Console.WriteLine("{project_name} takes no arguments..");
          return 1;
      }}
      {class_name} c = new {class_name}();
      Boolean result = true;
      return result.CompareTo(c.get_number() != 6);
    }}
}}

a  project('{project_name}', 'cs',
  version : '{version}',
  default_options : ['warning_level=3'])

stlib = shared_library('{lib_name}', '{source_file}',
  install : true,
)

test_exe = executable('{test_exe_name}', '{test_source_file}',
  link_with : stlib)
test('{test_name}', test_exe)

# Make this library usable as a Meson subproject.
{ltoken}_dep = declare_dependency(
  include_directories: include_directories('.'),
  link_with : stlib)

c                      s0   e Zd Z fddZd	ddZd	ddZ  ZS )
CSharpProjectc                   s   t    |j| _|j| _d S )N)super__init__nameversion)selfoptions	__class__ home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/lib/python3.10/site-packages/mesonbuild/templates/cstemplates.pyr   _   s   
zCSharpProject.__init__returnNonec                 C  s   t dd| j }| }|d |dd   }|d |dd   d }t|dddtj| j|d	 td
dddt	j| j| j|| j
d d S )N	[^a-z0-9]_r      .cswutf-8encoding)project_name
class_namemeson.build)r   Zexe_namesource_namer   )resubr   lowerupperopenwritehello_cs_templateformathello_cs_meson_templater   )r	   lowercase_tokenuppercase_tokenr   r   r   r   r   create_executabled   s    zCSharpProject.create_executablec           	      C  s  t dd| j }| }|d |dd   }|d |dd   d }|d }|d |dd   d }|d |dd   d }|||||||| j||| jd}t|d	d
dtj	di | t|d	d
dt
j	di | tdd	d
dtj	di | d S )Nr   r   r   r   _testr   z_test.cs)ZutokenZltoken
class_testr   Zsource_fileZtest_source_fileZtest_exe_namer   lib_nameZ	test_namer   r   r   r   r   r   )r   r   r   r   r    r   r!   r"   lib_cs_templater$   lib_cs_test_templatelib_cs_meson_template)	r	   r&   r'   r   r*   Zproject_testZlib_cs_nameZtest_cs_namekwargsr   r   r   create_libraryr   s,     $zCSharpProject.create_library)r   r   )__name__
__module____qualname__r   r(   r0   __classcell__r   r   r   r   r   ^   s    
r   )
__future__r   Zmesonbuild.templates.sampleimplr   r   r#   r%   r,   r-   r.   r   r   r   r   r   <module>   s   
