-
Notifications
You must be signed in to change notification settings - Fork 64
Fix #51. Добавлено автоматическое определение типа файла при сборке из исходников #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
v8files-extractor.os
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я предлагаю сразу выбрасывать исключение, потому что
- либо ошибка реализации
- либо сборка вообще не имеет смысла из-за неверных данных
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А в случае рекурсивной сборки? Ошибка в одном файле должна ложить всю сборку?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сейчас в случае ошибки будет собрано что-то без расширения, это разве нормально?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не совсем нормально. Однако же самому механизму v8unpack не важен тип файла. Он нужен только для расширения. То есть если нашему неудавшемуся файлу руками добавить верное расширение, то он запустится (в случае изначально корректной структуры).
С другой стороны это настолько маловероятный сценарий, что, думаю, действительно стоит добавить исключение, как нечто из ряда вон выходящее.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поправил.
|
@nixel2007 Вопрос остался - какой каталог нужно указывать в качестве каталога исходников при сборке? |
|
Надо указывать Fixture. |
|
По каталогу исходников понятно. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы здесь еще добавил строку
ИдентификаторТипаОбъекта = НРег(СокрЛП(ИдентификаторТипаОбъекта));
так как 1С допускает наличие пробельных символов между запятыми и значениями в своем формате сериализации. И идентификаторы тоже могут быть в верхнем регистре (в ранних версиях 8.0 так и было).
|
@awa15 Спасибо, добавил |
v8files-extractor.os
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ИМХО Для скорости лучше не читать весь файл, а считать только 3 строки построчно.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Есть уверенность, что четвертый элемент всегда будет в третьей строке?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Посмотрел разные файлы, есть эта закономерность.
Считай 5-7 строк для гарантии :) все лучше, чем весь файл считывать.
Я посмотрел precommit1c\src\tests\Fixture\und\a981feb3-1026-4b79-b758-d406f4e487a1, размер 4К, 169 строк
прочие файлы смотрел, там объем много меньше.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Готово
Fix #51. Добавлено автоматическое определение типа файла при сборке из исходников
Fix #51
Как обычно буду рад замечаниям и предложениям, на мой взгляд, получилось несколько хардкорно.