File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
onlinejudge_verify/languages Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 5
5
import pathlib
6
6
import subprocess
7
7
from logging import getLogger
8
+ from turtle import st
8
9
from typing import *
9
10
import distutils .version
10
11
import shutil
@@ -92,6 +93,14 @@ def _check_env(path: pathlib.Path):
92
93
_check_embedded_existing (_resolve_csproj (path ))
93
94
94
95
96
+ @functools .lru_cache (maxsize = None )
97
+ def _check_no_embedder (csproj_path : pathlib .Path ) -> None :
98
+ root = ET .parse (csproj_path ).getroot ()
99
+ if root .find ('.//PackageReference[@Include="SourceExpander.Embedder"]' ):
100
+ logger .error (
101
+ " Test project(%s) has `SourceExpander.Embedder` reference. Libraries and tests should not be in same project." , str (csproj_path ))
102
+
103
+
95
104
@functools .lru_cache (maxsize = None )
96
105
def _resolve_csproj (path : pathlib .Path ) -> Optional [pathlib .Path ]:
97
106
path = path .resolve ()
@@ -120,7 +129,9 @@ def _expand_code_dict(csproj_path: pathlib.Path) -> Dict[pathlib.Path, str]:
120
129
@functools .lru_cache (maxsize = None )
121
130
def _expand_code (path : pathlib .Path ) -> bytes :
122
131
_check_expander_console ()
123
- d = _expand_code_dict (_resolve_csproj (path ))
132
+ csproj_path = _resolve_csproj (path )
133
+ _check_no_embedder (csproj_path )
134
+ d = _expand_code_dict (csproj_path )
124
135
return d [path ].encode ('utf-8' )
125
136
126
137
You can’t perform that action at this time.
0 commit comments